Skip to content

v4 CSS switch from :before/:after to ::before/::after #17052

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

Closed
toastal opened this issue Aug 19, 2015 · 5 comments
Closed

v4 CSS switch from :before/:after to ::before/::after #17052

toastal opened this issue Aug 19, 2015 · 5 comments

Comments

@toastal
Copy link

toastal commented Aug 19, 2015

With the drop of IE8 support in v4, it would make sense to use the proper colon-age, ::before, ::after, to promote best practices since pseudo elements are supposed to have double colons.

@cvrebert cvrebert added this to the v4.0.0-alpha.2 milestone Aug 19, 2015
@cvrebert cvrebert changed the title v4 CSS switching single colon to double colon on before and after v4 CSS switch from :before/:after to ::before/::after Aug 19, 2015
@mdo
Copy link
Member

mdo commented Aug 21, 2015

I'm inclined to stay with the single—everyone supports it still and we didn't do the single : just for IE8. Most folks don't write the double anyway.

@kkirsche
Copy link
Contributor

@mdo I'm not sure I agree that it should use single. I'd ask what is the reason for straying from what the actual spec is. In my opinion, it makes more sense to follow the spec and use the correct format than to use a deprecated or legacy format just because it maintains support and some people (arguably) have bad habits on using double colons. This also means that should the project want to use all of the pseudo elements possible it would (potentially) not be able to.

The key reason is (emphasis being mine):

This :: notation is introduced by the current document in order to establish a discrimination between pseudo-classes and pseudo-elements. For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2 (namely, :first-line, :first-letter, :before and :after). This compatibility is not allowed for the new pseudo-elements introduced in this specification.

From: http://www.w3.org/TR/selectors/#pseudo-elements

@toastal
Copy link
Author

toastal commented Aug 24, 2015

I'd like to echo @kkirsche for more eloquently voicing my thoughts about the matter. We're unsure how long vendors will support single colon and we know that the spec has been defined to be double--and all major browsers support the spec's syntax now. If anything, a big project like TWBS would teach the 'lazy' folks that they should be using the double colon syntax. I know I personally learned quite a bit about CSS & JS because of this project. It's about setting a good example.

@mdo
Copy link
Member

mdo commented Aug 24, 2015

Ugh fine I guess we'll be responsible then 😁.

kkirsche added a commit to kkirsche/bootstrap that referenced this issue Aug 24, 2015
@mdo
Copy link
Member

mdo commented Aug 24, 2015

Huzzah! #17058

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

4 participants