-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Ability to style default summary in <details> #8770
Comments
Just out of curiosity, why limit that to the 'default summary' instead of making it apply to the 'active summary' (ie, whatever the part internally playing the summary role is). I don't have a good name for that, so I'll just use The UA sheet would just be:
And so would most actual stylesheets, I expect. If that makes any sense, it needs a better name. |
I couldn't think of any other case where a pseudo-element selector selected something that wasn't a pseudo-element, or shadow DOM. |
I guess I was suggesting that maybe it isn't the |
Yeah, that could work. I see the appeal of having a single selector for it. Not sure what to name it, but I'm sure there's a name out there. |
This seems reasonable to me. You should probably file an issue for the CSS WG as well. cc @whatwg/css |
We may as well, at the same time, expose the details content. It'd be nice to allow CSS to override the open/close state. |
That seems like it could create misalignments with how the details summary could expose the content as in the collapsed state, but it would actually be shown. And vice versa. Likely could be done, but just needs to be on the checklist of things to do if allowing that |
|
@scottaohara fwiw, |
@jakearchibald true, but there is no native HTML element that triggers a dialog that would expose an expanded/collapsed state. So not a 1:1 comparison with details/summary where if you make the contents of the details visible by CSS then the state communicated when someone interacts with the summary element would also need to change based on this modification. |
Given that all major engines (Chromium, Gecko, WebKit) implement (Also see an explainer I'm working on about improving stylability of |
I'm not sure there's agreement that. In particular I find it rather inconsistent with existing elements to use userland shadow tree APIs. The internal shadow tree is defined already (in the Rendering section) and defining built-in pseudo-elements for it as suggested upthread seems reasonable. |
Unless I'm missing something, there doesn't seem to be a way to style the auto-generated
<summary>
for<details>
.Should we add something like this:
That also means the styling of the
<summary>
can move entirely into the UA sheet:The text was updated successfully, but these errors were encountered: