Skip to content

Commit

Permalink
Merge pull request #350 from City-of-Helsinki/UHF-9497
Browse files Browse the repository at this point in the history
UHF-9497: Removed custom icons for HDBT subtheme
  • Loading branch information
khalima authored Mar 7, 2024
2 parents 44ece4a + 2df2cf1 commit 8d62031
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 209 deletions.
20 changes: 0 additions & 20 deletions public/themes/custom/hdbt_subtheme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,15 @@ hdbt_subtheme
│ │ └───...
│ └───js
│ │ │ common.js
│ └───icons
│ | some-icon.svg
└───dist
└───css
| styles.min.css
└───js
| bundle.min.js
└───icons
| sprite.svg
```

## How tos

### How can I add a new SVG icon and then use it on my site.

You can add your custom icons to `./src/icons/`. F.e. `my-awesome-icon.svg`.
Running `nvm use && npm i && npm run build` will collect the icon to the sprite.svg and it should then be available for use on your site by calling `my-awesome-icon`. Just remember to clear caches.
The icons can be used in twig like so:

{# HDBT Subtheme specific icons #}
{% include "@hdbt_subtheme/misc/icon.twig" with {icon: 'my-awesome-icon'} %}

{# HDBT specific icons #}
{% include "@hdbt/misc/icon.twig" with {icon: 'google-view'} %}

To use the icon in SCSS, you can call it like so:

background-image: url('../icons/my-awesome-icon.svg');

### My javascript has unexpected errors when loading a page in Drupal.

If you have compiled the code with dev-flag (`nmp run dev`), then the sourcemaps expects the JS files to be found in correct places.
Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions public/themes/custom/hdbt_subtheme/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const glob = require('glob');
const FriendlyErrorsWebpackPlugin = require('@nuxt/friendly-errors-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
const SvgToSprite = require('./webpack.svgToSprite');
const { merge } = require('webpack-merge');

// Handle entry points.
Expand Down Expand Up @@ -105,12 +104,6 @@ module.exports = (env, argv) => {
extensions: ['.js', '.json'],
},
plugins: [
// Uncomment following lines to create svg icon sprite.
// new SvgToSprite(
// path.resolve(__dirname, 'src/icons/**/*.svg'),
// 'icons/hdbt-subtheme-sprite.svg',
// 'icons.json'
// ),
new FriendlyErrorsWebpackPlugin(),
new RemoveEmptyScriptsPlugin(),
new MiniCssExtractPlugin({
Expand Down
181 changes: 0 additions & 181 deletions public/themes/custom/hdbt_subtheme/webpack.svgToSprite.js

This file was deleted.

0 comments on commit 8d62031

Please sign in to comment.