Skip to content
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

CSS attribute selectors should only match on known HTML attributes #261

Closed
Gr8Gatsby opened this issue Apr 25, 2018 · 0 comments
Closed

Comments

@Gr8Gatsby
Copy link

SOMA#852

Migrated issue

notes:

Raptor template compiler should be more restrictive with attribute selector. When compiling the template, the compiler decides if an attribute will be will be passed as attribute or a property. Because of this attributes present in the template is not guaranteed to be reflected on the DOM.

Proposal

  • CSS compiler should throw when transforming if an attribute selector is not part of the Global HTML Attribute list
[my-attr] {} /* throws */
[my-attr="foo"] {} /* throws */
  • CSS compiler should permit known attributes on specific element
input[max] {} /* is OK */
div[max] {} /* throws */
[max] {} /* throws and report that should be more specific */
pmdartus added a commit that referenced this issue May 21, 2018
## Details

This PR restricts the usage of attributes in the stylesheet:
* global HTML attributes are permitted
* known attributes selectors are permitted on known elements selectors
* attribute selectors are banned for custom elements

Fix #261 

## Does this PR introduce a breaking change?

* [X] Yes
* [ ] No

If yes, please describe the impact and migration path for existing applications:
Components won't compile if they already use attribute selectors in their stylesheet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant