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

Allow build of scss file from blueprintjs package file(s) #2986

Closed
avkonst opened this issue Sep 30, 2018 · 4 comments
Closed

Allow build of scss file from blueprintjs package file(s) #2986

avkonst opened this issue Sep 30, 2018 · 4 comments

Comments

@avkonst
Copy link

avkonst commented Sep 30, 2018

Environment

  • Package version(s): 3.6.1 +
  • Browser and OS versions: any

Feature request

This is the continuation for #2976 (comment)

I would like to node-sass build blueprintjs.scss file from the blueprintjs/core package in my project. This would allow me to restyle and override things the way I would like to. Build of the scss file depends on sass-inline-svg.js script which is also included in the package and it is good. But this script requires few SVG icons as .svg files placed in /resources/icons which are missed in the distributed package. So the build of the scss file is failed without these .svg files. Workaround is to rewrite the script to point out to manually / one-off downloaded required .svg files. This is not future proof as the upgrade to newer blueprintjs versions will require re-downloading of the required (and potentially new) svg files.

Proposed feature: track what svg files are referred in the scss file and include them to the package together with blueprintjs.scss and sass-inline-svg.js supporting relatively correct paths.

@avkonst
Copy link
Author

avkonst commented Dec 13, 2018

The issue is not relevant anymore after I migrated to react-scripts 2.1.1 from react-scripts-ts. It seems importing blueprint.scss in react app built with react-scripts is working properly.

@danilofes
Copy link

Although this issue is closed I didn't manage to get blueprintjs.scss to work. When I import the scss, the build does not fail, but the breadcrumbs' icons don't show (similarly to #3059).

Specifically, by inspecting the styles I noticed that this is what I get when importing the scss

.bp3-breadcrumbs > li::after {
  background: svg-icon("16px/chevron-right.svg", (path: (fill: #5c7080)));
}

In contrast, this is what I get when importing the css

.bp3-breadcrumbs > li::after {
  background: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18-.18.29-.43.29-.71 0-.28-.11-.53-.29-.71z' fill='%235C7080'/%3e%3c/svg%3e);
}

I'm simply importing the scss like this:

@import '~@blueprintjs/core/src/blueprint.scss'

Am I doing something wrong?

P.S.: I'm using react-scripts 2.1.1 (from official create-react-app)

@avkonst
Copy link
Author

avkonst commented Feb 27, 2019

You are right. I was wrong reporting the issue is solved. I missed that the breadcrumbs still not working.

@avkonst
Copy link
Author

avkonst commented Apr 9, 2019

Here is the workaround available: #2976 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants