[css-display-4] Add inner and outer display properties
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Description
CSS display level 3 adds the great change of allowing controlling the inner and outer display of an element. However it does not give a way to control them independently.
e.g. Consider a web component with a shadow root that would like to lay out its internals:
<user-summary>
<#shadow-root>
<style>
:host {
display: block grid;
grid:
"avatar displayName" max-content
"avatar userName" max-content
/ auto auto !important;
}
#avatar {
grid-area: avatar;
}
#displayName {
grid-area: displayName;
}
#userName {
grid-area: userName;
}
</style>
<img id="avatar" src="{{avatarSrc}}"/>
<div class="name">{{displayName}}</div>
<div class="username">{{userName}}</div>
</#shadow-root>
</user-summary>
In this case the grid styling is important for the functionality of the component, however this comes with a couple caveats:
- In order to style the outer display a user needs to know the internal inner display, e.g.
user-summary { display: inline grid; } - Prevention of overriding the grid style using
!importantbreaks the ability to makeuser-summarya different outer style
As such I'd like to propose adding display-inside/display-outside as individual properties, then the styles could be written as such:
:host {
display-outside: block; /* Can override externally */
display-inside: grid !important; /* Cannot override externally as it is necessary */
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CSS Display Level 3 discussion and the issue's shadow-root example; compare the proposed display-inside/display-outside properties with current handling of inner and outer display. Done means the Working Group has resolved the proposal and documented the resulting specification change or disposition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100