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

scss with font path variable #563

Closed
xpressivecode opened this issue Dec 19, 2020 · 8 comments · Fixed by #978
Closed

scss with font path variable #563

xpressivecode opened this issue Dec 19, 2020 · 8 comments · Fixed by #978
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@xpressivecode
Copy link

Is there any chance of a scss release that includes a font path variable?

@mdo mdo added the enhancement New feature or request label Dec 22, 2020
@mdo mdo added the help wanted Extra attention is needed label Jan 7, 2021
@mdo
Copy link
Member

mdo commented Jan 7, 2021

If anyone wants to contribute, I'd love to review a PR for this! Unsure if it's doable with Fantasticon.

@XhmikosR
Copy link
Member

XhmikosR commented Jan 7, 2021

We could ask for this upstream.

@xpressivecode
Copy link
Author

xpressivecode commented Jan 16, 2021

I'm unfamiliar with Fantasticon, but locally if I create a scss file with an updated font-face, I get the desired results.

$twbs-font-path: "./fonts" !default;

@font-face {
  font-family: "bootstrap-icons";
  src: url("#{$twbs-font-path}/bootstrap-icons.woff?4601c71fb26c9277391ec80789bfde9c") format("woff"),
  url("#{$twbs-font-path}/bootstrap-icons.woff2?4601c71fb26c9277391ec80789bfde9c") format("woff2");
}
...

Could the build process generate this scss file in tandem with the css file, or afterwards? Maybe tie into an after hook on the "icons-font" task.

I'd be happy to push a PR if you think this would be a suitable workaround for the time being?

@ffes
Copy link
Contributor

ffes commented Mar 1, 2021

When you search for "SASS" this issue wouldn't be shown. That's why I'm adding this comment.

@gs1-rob-392
Copy link

it could be very helpful to have a .scss file.

@rjcarneiro
Copy link

I'm facing this issue at this moment and considering not to use bootstrap icons exactly because of that. The current fonts folder is relative where the css is, in my case, all my css's are in ~/css.

Meaning, it's searching for the fonts in ~/css/fonts/bootstrap-icons.woff2 which is 💩 .

@xpressivecode
Copy link
Author

It really would be nice to have the ability to set a path in a scss file

$twbs-font-path: "bootstrap-icons/font/fonts";
@import "bootstrap-icons/font/bootstrap-icons";

@tomkell29
Copy link

Hi,

Is there any update on this issue?

I also have the same problem as @rjcarneiro in that the css file included in the NPM package is relative to the "css" folder. A variable would be great, or even just putting ../fonts instead of singular dot would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants