Skip to content

[css-pseudo] Pseudo Style apply-style-this-element-only Inheritance Control styles, margin padding, background colors.. #11440

@wesleyolis

Description

@wesleyolis

Basically control the propagation and inheritance of styles more granular and specifically, because one is not really able to write selectors to be more specific in more complex situations it becomes difficult.
I typically see this being used with #11441

div:apply-style-this-element-only {
margin: 10px;
font-size:1.2em;
}

This would only apply the style to first div element/template and not its contained children elements.

<style>
div {
font-size:1em;
}

div.normal:apply-style-this-element-only {
font: 1.2em;
}
<style>

<div class='normal'>
Normal fontisze of 1.2em
<div >
larger fontsize of default 1 em
</div>
</div>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions