Π‘SS Container Queries
#css #container
β Link: https://javascript.plainenglish.io/css-container-queries-3393fbeb6ea8
#css #container
β Link: https://javascript.plainenglish.io/css-container-queries-3393fbeb6ea8
This media is not supported in your browser
VIEW IN TELEGRAM
πModern Component-Oriented Responsive Design with
#css #container
The modern CSS specification offers container queries via the @container at-rule for this requirement.
Look at the following sample:
@container#css #container
The modern CSS specification offers container queries via the @container at-rule for this requirement.
Look at the following sample:
<div class="alert">
<h3>Lorem ipsum dolor sit amet</h3>
<button>Lorem ipsum</button>
<button>Lorem ipsum</button>
</div>
.alert {
background-color: #ddd;
padding: 12px;
resize: horizontal;
overflow: hidden;
container-type: inline-size;
}
.alert h3 {
padding: 0 0 6px 0;
margin: 0 0 12px 0;
border-bottom: solid 2px #eb7e3b;
}
.alert button {
padding: 12px;
border: none;
margin-right: 6px;
}
@container (width < 400px) {
.alert button {
width: 100%;
box-sizing: border-box;
}
.alert button:not(:last-child) {
margin-bottom: 10px;
}
}π2
π Π‘SS becomes SCSS
#css #scss #root #nesting #is #has #container @layer
β Article link
#css #scss #root #nesting #is #has #container @layer
Sass has established itself as a powerful preprocessor installed locally, forming the backbone of my projects for over a decade. It enabled me to efficiently organize scalable and stable CSS packages. Even today, I still consider Sass to be an extraordinarily powerful tool. Yet, as we step into the year 2024, itβs undeniable that CSS has undergone rapid development. Features that were once unique to Sass are now natively integrated into CSS, including variables and the latest highlight: CSS Nesting.
β Article link
π₯1π1