-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
The CSS selector desugaring needs better documented. #20
Comments
For context, this recently came up on Gitter, but I've seen it come up several times previously, and I myself occasionally run into this glitch. It should probably be made clear that In addition to all this, a nice and clear warning should be left in the hyperscript docs that explains that:
Side note: this section is redundant with text within the DOM attributes section and needs removed. And the DOM attributes section needs renamed to something like |
A PR resolving this should probably combine this with MithrilJS/mithril.js#2345 and kill both in one fell swoop. They're closely related enough, especially in light of the gotcha in the previous comment, that it'd be worth combining them and approaching it holistically. |
This is mostly fixed, but the |
I guess |
m("tag[spellcheck=false]") should produce This is a bug. |
In the documentation, it briefly goes over the CSS selector sugar. However, it doesn't document precisely how it gets desugared:
m("tag[attr]")
→m("tag", {attr: true})
m("tag[attr=]")
→m("tag", {attr: ""})
m("tag[attr=...]")
→m("tag", {attr: "..."})
m("tag[attr='...']")
→m("tag", {attr: "..."})
m('tag[attr="..."]')
→m("tag", {attr: "..."})
m("tag.foo.bar", {class: "baz"})
→m("tag", {class: "foo bar baz"})
m("tag[class=foo]", {class: "bar"})
→m("tag", {class: "foo bar"})
m("tag.foo[class=bar].baz")
→m("tag", {class: "foo bar baz"})
Also, our magic
true
→""
semantics for attributes (but not properties!) needs documented.The text was updated successfully, but these errors were encountered: