Replies: 2 comments
-
Pseudo-selectors in Here is an example of how to use a simple :after:
If the styled component is the same as the target element. You can do the following:
If you are targeting an element nested inside the styled component:
|
Beta Was this translation helpful? Give feedback.
-
The reason the first method works and the second one doesn't is because in the first method, &::after refers to the full selector, including the parent selector. The .list a::after {
/* styles */
} In the second method, there's no In short, &::after ensures that the selector is correctly compiled as .list a::after, which is why the first approach works. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1:
2:
At first time, i used the second way in my project, and it's unuseful, but when i change it to the first way, it's run.
But i can't understand why?
plz.
Beta Was this translation helpful? Give feedback.
All reactions