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

Fix selector bug #3

Merged
merged 4 commits into from
Feb 23, 2017
Merged

Fix selector bug #3

merged 4 commits into from
Feb 23, 2017

Conversation

tomm1996
Copy link
Contributor

@tomm1996 tomm1996 commented Feb 23, 2017

Hey,

I found and fixed a bug regarding ampersand-selectors in _reformat.scss.
Using &[href^="ftp://"] on top level is not supposed to work since & is a reference to the parent selector.

Both, grunt-sass and node-sass throw the following error when trying to compile that file:

"status": 1,
"file": "~/projects/gutenberg/scss/_utilities.scss",
"line": 17,
"column": 1,
"message": "Base-level rules cannot contain the parent-selector-referencing character '&'.\n\nBacktrace:\n\tscss/_utilities.scss:17",
"formatted": "Error: Base-level rules cannot contain the parent-selector-referencing character '&'.\n\n > Backtrace:\n \tscss/_utilities.scss:17\n
on line 17 of scss/_utilities.scss\n>> &abbr[title], &acronym[title] {\n ^\n"

Apparently, for some reason it's okay for gulp-sass, which is why you didn't get an error when compiling the framework.

Further information:
http://thesassway.com/intermediate/referencing-parent-selectors-using-ampersand

EDIT:
you can reproduce this error by running
$ npm i node-sass -g
$ node-sass ./scss/gutenberg.scss .

in the directory root.

I just noticed that this error occurs in utilities.scss aswell. Sorry for the trouble, I added the fix to the pull request

content: " (" attr(href) ")";
font-size: 80%;
a {
[href^="http://"], [href^="https://"], [href^="ftp://"] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing & here. Have a look at the compiled CSS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, I fixed that now in 83979ce

@BafS BafS merged commit 3096403 into BafS:master Feb 23, 2017
@BafS
Copy link
Owner

BafS commented Feb 23, 2017

Thanks a lot!

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

Successfully merging this pull request may close these issues.

3 participants