Answer the question
In order to leave comments, you need to log in
How to remove space before pseudo-classes/-elements after compiling scss to css?
Good afternoon! There was a problem with the compiled css file.
Code examples:
scss:
.header{
display:block;
::after{
}
}
.header {
display:block;
}
.header ::after{}
header {
display:block;
}
header::after{}
Answer the question
In order to leave comments, you need to log in
Why don't you put an ampersand before the pseudo-class? &::after, the compiler thinks that this is a nested class, so it puts a space and the ampersand lets you know what to use next with the parent class, it means 'and', that is
. header {
/*some style*/
&::after {
content '';
}
}
And so on
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question