csstools / postcss-plugins

PostCSS Tools and Plugins
https://preset-env.cssdb.org/
MIT No Attribution
904 stars 71 forks source link

Deprecation warning from Chrome when using custom selectors #1340

Closed jeroenrodenburg closed 7 months ago

jeroenrodenburg commented 7 months ago

Chrome (Version 123.0.6312.58) is giving console errors when using a @custom-selector.

For example: [Deprecation] Custom state pseudo classes are changing from ":--headings" to ":state(headings)" soon. See more here: https://github.com/w3c/csswg-drafts/issues/4805

romainmenke commented 7 months ago

Hi @jeroenrodenburg,

This is unrelated to the PostCSS plugin and not something we can resolve.

@custom-selector is a feature that no browser has implemented.

Custom state pseudo classes however were implemented by Chrome and had the same syntax :--foo. Chrome is warning about a deprecation in custom state pseudo classes.


This also implies that you are preserving @custom-selector notation and serving that to clients.

The default is to not preserve this future syntax : https://preset-env.cssdb.org/playground/#JTdCJTIyc291cmNlJTIyJTNBJTIyJTQwY3VzdG9tLXNlbGVjdG9yJTIwJTNBLS1mb28lMjAuZm9vJTJDJTIwLmJhciUzQiU1Q24lNUNuJTNBLS1mb28lMjAlN0IlNUNuJTIwJTIwY29sb3IlM0ElMjByZWQlM0IlNUNuJTdEJTIyJTJDJTIyY29uZmlnJTIyJTNBJTdCJTIyYnJvd3NlcnMlMjIlM0ElNUIlMjIlM0UlMjAwLjIlMjUlMjBhbmQlMjBub3QlMjBkZWFkJTIyJTVEJTJDJTIybWluaW11bVZlbmRvckltcGxlbWVudGF0aW9ucyUyMiUzQTAlMkMlMjJzdGFnZSUyMiUzQTElMkMlMjJsb2dpY2FsJTIyJTNBJTdCJTIyaW5saW5lRGlyZWN0aW9uJTIyJTNBJTIybGVmdC10by1yaWdodCUyMiUyQyUyMmJsb2NrRGlyZWN0aW9uJTIyJTNBJTIydG9wLXRvLWJvdHRvbSUyMiU3RCUyQyUyMmZlYXR1cmVzJTIyJTNBJTdCJTIybmVzdGluZy1ydWxlcyUyMiUzQSU1QiUyMmF1dG8lMjIlMkMlN0IlMjJlZGl0aW9uJTIyJTNBJTIyMjAyNC0wMiUyMiU3RCU1RCU3RCU3RCU3RA==

jeroenrodenburg commented 7 months ago

Thanks @romainmenke , all clear!