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

Missing presentational attributes #27

Open
abarth opened this issue Jun 15, 2014 · 5 comments
Open

Missing presentational attributes #27

abarth opened this issue Jun 15, 2014 · 5 comments

Comments

@abarth
Copy link

abarth commented Jun 15, 2014

Many HTML elements have presentation attributes, which get translated into CSS properties that get inserted into a particular place in the cascade:

"The UA may choose to honor presentational attributes in an HTML source document. If so, these attributes are translated to the corresponding CSS rules with specificity equal to 0, and are treated as if they were inserted at the start of the author style sheet. They may therefore be overridden by subsequent style sheet rules."

http://www.w3.org/TR/CSS2/cascade.html

I don't know of any way currently for a web component to insert presentational CSS into the correct place in the cascade.

@dglazkov
Copy link
Contributor

@tabatkins for moar insight.

@domenic
Copy link
Owner

domenic commented Jun 15, 2014

I might be way off-base, but this seems tenuously connected to the proposal to allow authors to set their own initial styles. It sounds like what we're talking about here aren't actually initial styles proper, but they seem to serve similar use cases for authors.

One way of looking at this connection might be, if we provide some way for authors to set these "specificity 0 default styles," we have also solved some of the use cases in that thread (although not the transition-timing-function one, I think).

@tabatkins
Copy link

Elliot and I have discussed, in the context of constructable Stylesheet objects, being able to set up "default" sheets that apply at the specificity discussed here. There's a bunch of interesting concept-space lying here that we should explore.

@domenic
Copy link
Owner

domenic commented Jun 15, 2014

That sounds really nice. "Constructable Stylesheet objects" sounds much like the underpinnings of <custom-style>, too.

I imagine then we could add a declarative version, <style default> or something, once the imperative API is figured out.

@tabatkins
Copy link

Specifically:

  1. Being able to set styles at "default" level, below all non-default styles in the cascade. (Just using * as the selector almost does this; the only difference is that this is below * selector rules.)
  2. Being able to set styles at "initial" level, below even the default styles, that fill in values unspecified in shorthands too. (This might subsume the previous one. Need use-cases to tell.)
  3. Being able to create stylesheets that apply in all components at some default level. You can't use * /deep/ * for this, because outer rules win over all inner rules when dealing with cross-shadow contexts. (Most of the time this is what you want, as you're usually tweaking existing component styles with that kind of style.)

domenic added a commit that referenced this issue Dec 19, 2014
Notably, this means even <custom-div> is not faithful.
domenic added a commit that referenced this issue Dec 19, 2014
Notably, this means even <custom-div> is not faithful.
domenic added a commit that referenced this issue Dec 19, 2014
Notably, this means even <custom-div> is not faithful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants