Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-9497: Removed custom icons for HDBT subtheme #350

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading