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

$popover-arrow-width SCSS variable in shards.css file #32

Closed
hansy opened this issue May 1, 2018 · 3 comments
Closed

$popover-arrow-width SCSS variable in shards.css file #32

hansy opened this issue May 1, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@hansy
Copy link

hansy commented May 1, 2018

I kept receiving parsing errors when trying to import styles in a Node project. These lines might be the culprit:

shards-ui/dist/css/shards.css

Lines 3973 to 3979 in bab8f42

.popover .arrow::before {
border-width: calc($popover-arrow-width + 1px);
}
.popover .arrow::after {
border-width: calc($popover-arrow-width + 1px);
}

@hisk
Copy link
Contributor

hisk commented May 1, 2018

@hansy Can you please provide more details about your current setup? What version of Node are you using and what errors are you receiving?

@hansy
Copy link
Author

hansy commented May 1, 2018

Of course. Actually (I apologize), I'm using Nuxt v1.40, which is basically Vue.js.

Everything is the default configuration except that I included the use of the SASS preprocessor (yarn add node-sass sass-loader), and added a root .scss path to nuxt.config.js:

// nuxt.config.js

module.exports = {
  // ... default config
  css: [
    '@/assets/scss/index.scss',
  ],
}

My /assets/scss/index.scss is:

@import 'bootstrap/scss/bootstrap.scss';
@import 'shards-ui/dist/css/shards.min.css';

This fails with:

Module build failed: Error: Lexical error on line 1. Unrecognized text.
$popover-arrow-width
^
    at Parser.parseError (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:160:21)
    at Object.parseError (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:309:28)
    at Object.next (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:564:25)
    at Object.lex (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:574:22)
    at lex (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:196:27)
    at Parser.parse (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/parser.js:209:26)
    at /Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/index.js:35:30
    at walk (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-value-parser/lib/walk.js:15:13)
    at ValueParser.walk (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-value-parser/lib/index.js:18:5)
    at exports.default (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/node_modules/reduce-css-calc/dist/index.js:29:51)
    at transformValue (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/dist/lib/transform.js:24:45)
    at exports.default (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/dist/lib/transform.js:54:100)
    at /Users/hansy/Dropbox/projects/project/landing/node_modules/postcss-calc/dist/index.js:28:52
    at /Users/hansy/Dropbox/projects/project/landing/node_modules/postcss/lib/container.js:144:26
    at Rule.each (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss/lib/container.js:110:22)
    at Rule.walk (/Users/hansy/Dropbox/projects/project/landing/node_modules/postcss/lib/container.js:143:21)

 @ ./assets/scss/index.scss 4:14-200 13:3-17:5 14:22-208
 @ ./.nuxt/App.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js

Commenting out the shards import statement "resolves" the error.

@hisk hisk added the bug label May 1, 2018
@hisk hisk self-assigned this May 1, 2018
@hisk
Copy link
Contributor

hisk commented May 1, 2018

@hansy Great find! The $popover-arrow-width is not interpolated properly in the dist Shards CSS files and therefore the css-loader cannot parse it as it's not valid CSS.

$popover-arrow-outer-width: calc($popover-arrow-width + 1px) !default;

I'll push the fix for this bug in the 2.0.3 patch which will be published in the following days or Monday at the latest. Until then, a quick fix would be to recompile the shards.scss main file and override the $popover-arrow-width variable like so:

 $popover-arrow-outer-width: $popover-arrow-width + 1;

Sorry for the inconvenience and thank you for reporting this bug. 😃

@hisk hisk mentioned this issue May 2, 2018
hisk added a commit that referenced this issue May 2, 2018
* Fix `$popover-arrow-width` interpolation issue #32.

* Update package dependencies.

* Add support for nouislider 11.1.0 - #31

* Update readme.

* Fix demo page responsive display issues #29

* Update dependencies and bump version number.

* Update distributed files.

* Fix readme description.

* Update changelog.
@hisk hisk added this to the Patch 2.0.3 milestone May 2, 2018
@hisk hisk closed this as completed May 2, 2018
jevel9 referenced this issue in zygotecnologia/shards-ui Feb 3, 2019
* Fix `$popover-arrow-width` interpolation issue #32.

* Update package dependencies.

* Add support for nouislider 11.1.0 - #31

* Update readme.

* Fix demo page responsive display issues #29

* Update dependencies and bump version number.

* Update distributed files.

* Fix readme description.

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

No branches or pull requests

2 participants