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

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

Open
wesleyolis opened this issue Jan 5, 2025 · 0 comments

Comments

@wesleyolis
Copy link

wesleyolis commented Jan 5, 2025

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant