Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Use HTML5 data attributes as rule selectors #13

Open
Faterou opened this issue Aug 7, 2015 · 1 comment
Open

Use HTML5 data attributes as rule selectors #13

Faterou opened this issue Aug 7, 2015 · 1 comment

Comments

@Faterou
Copy link
Contributor

Faterou commented Aug 7, 2015

Originally reported by: Sylvain Hallé (Bitbucket: sylvainhalle, GitHub: sylvainhalle)


HTML5 allows us to put data attributes inside any HTML element. These could be used to declare, within the HTML markup, what properties apply to what parts of the page. For example, one could write an element like this:

#!html

<ul data-role="horizontal-menu">

and write a Cornipickle rule (or set of rules) that apply to all elements with a given data-role. This would be orthogonal to using CSS classes.


@Faterou
Copy link
Contributor Author

Faterou commented Apr 18, 2016

Original comment by Sylvain Hallé (Bitbucket: sylvainhalle, GitHub: sylvainhalle):


Proposed syntax (cf. StackOverflow):

$(p.myclass[data-role=horizontal-menu])

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant