Skip to content

Instantly share code, notes, and snippets.

@anova
Created March 10, 2026 09:00
Show Gist options
  • Select an option

  • Save anova/9e23bcbacadc2443b71d67831195e40f to your computer and use it in GitHub Desktop.

Select an option

Save anova/9e23bcbacadc2443b71d67831195e40f to your computer and use it in GitHub Desktop.
/* Modern responsive spacer written with Next-Gen CSS.
Note: This code was modernized and translated from SASS by Gemini.
Features:
- Uses Native CSS Nesting (No preprocessor required).
- Uses Media Query Range Syntax (>= operator) for better readability.
*/
.u-spacer {
/* Default (XS) state */
&[style*="--xs"] {
height: var(--xs);
}
/* Modern Media Query Syntax:
Using (width >= 576px) instead of (min-width: 576px).
*/
@media (width >= 576px) {
&[style*="--sm"] {
height: var(--sm);
}
}
@media (width >= 768px) {
&[style*="--md"] {
height: var(--md);
}
}
@media (width >= 992px) {
&[style*="--lg"] {
height: var(--lg);
}
}
@media (width >= 1200px) {
&[style*="--xl"] {
height: var(--xl);
}
}
@media (width >= 1400px) {
&[style*="--xxl"] {
height: var(--xxl);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment