I have not been using SASS for a very long time and wanted to know if there are some issues with pseudo-elements such as :first-child
or :last-child
?
This question is related to
css
sass
pseudo-element
I think that it is better (for my expirience) to use: :first-of-type
, :nth-of-type()
, :last-of-type
. It can be done whit a little changing of rules, but I was able to do much more than whit *-of-type
, than *-child
selectors.
First of all, there are still browsers out there that don't support those pseudo-elements (ie. :first-child, :last-child), so you have to 'deal' with this issue.
There is a good example how to make that work without using pseudo-elements:
-- see the divider pipe example.
I hope that was useful.
Source: Stackoverflow.com