<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>modern-css.com</title><description>Modern CSS snippets. Every old hack, replaced.</description><link>https://modern-css.com/</link><language>en-us</language><item><title>Modern CSS units you should know</title><link>https://modern-css.com/articles/modern-css-units-you-should-know/</link><guid isPermaLink="true">https://modern-css.com/articles/modern-css-units-you-should-know/</guid><description>A practical tour of CSS units shipped recently: dvh and svh for mobile viewports, container query units, lh for vertical rhythm, and cap for type-aware sizing.</description><pubDate>Fri, 01 May 2026 22:09:00 GMT</pubDate></item><item><title>Build an accessible carousel with only CSS</title><link>https://modern-css.com/articles/build-a-css-only-carousel/</link><guid isPermaLink="true">https://modern-css.com/articles/build-a-css-only-carousel/</guid><description>Build a fully accessible carousel using CSS scroll-button and scroll-marker pseudo-elements. No Swiper.js or JavaScript needed.</description><pubDate>Mon, 09 Feb 2026 09:00:00 GMT</pubDate></item><item><title>Build a fully styled select dropdown with base-select</title><link>https://modern-css.com/articles/build-a-styled-select-dropdown/</link><guid isPermaLink="true">https://modern-css.com/articles/build-a-styled-select-dropdown/</guid><description>Step-by-step guide to building a custom styled select dropdown using appearance: base-select and ::picker(select). No JavaScript library needed.</description><pubDate>Mon, 09 Feb 2026 09:00:00 GMT</pubDate></item><item><title>Build a tooltip system with popover hint and anchor positioning</title><link>https://modern-css.com/articles/build-a-tooltip-system/</link><guid isPermaLink="true">https://modern-css.com/articles/build-a-tooltip-system/</guid><description>Build a declarative tooltip system using popover=hint, interestfor, and CSS anchor positioning. No Tippy.js or JavaScript required.</description><pubDate>Mon, 09 Feb 2026 09:00:00 GMT</pubDate></item><item><title>Organizing CSS with cascade layers</title><link>https://modern-css.com/organizing-css-with-cascade-layers/</link><guid isPermaLink="true">https://modern-css.com/organizing-css-with-cascade-layers/</guid><description>Use cascade layers to organize CSS into predictable levels. No specificity wars, no !important, no selector stacking.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS isolation: Prevent z-index Overflow</title><link>https://modern-css.com/z-index-isolation/</link><guid isPermaLink="true">https://modern-css.com/z-index-isolation/</guid><description>Use isolation: isolate to contain z-index values within elements and prevent them from overlapping with fixed or floating content outside the container.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS border-shape: True Non-Rectangular Elements</title><link>https://modern-css.com/css-border-shape/</link><guid isPermaLink="true">https://modern-css.com/css-border-shape/</guid><description>Define custom element geometry with CSS border-shape so borders, shadows, and outlines follow the shape. No more clip-path masks that fight the rectangular box model.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS text-wrap-style: pretty for Long-Form Paragraphs</title><link>https://modern-css.com/pretty-paragraph-wrapping-without-orphan-words/</link><guid isPermaLink="true">https://modern-css.com/pretty-paragraph-wrapping-without-orphan-words/</guid><description>Avoid orphan words at the end of paragraphs with text-wrap-style: pretty. No manual non-breaking spaces or hand-edited copy in long-form content.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Animate &lt;details&gt; with ::details-content and interpolate-size</title><link>https://modern-css.com/animating-details-without-javascript-height/</link><guid isPermaLink="true">https://modern-css.com/animating-details-without-javascript-height/</guid><description>Animate native &lt;details&gt; open and close with ::details-content and interpolate-size: allow-keywords. No JavaScript scrollHeight measurement, no fixed max-height ladder.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Name-only @container queries without size conditions</title><link>https://modern-css.com/container-queries-without-size-conditions/</link><guid isPermaLink="true">https://modern-css.com/container-queries-without-size-conditions/</guid><description>Apply styles based on a container&apos;s name with @container, no size condition required. Replaces the dummy (width &gt; 0) hack and keeps name-based context queries clean.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS forced-colors media query for Windows High Contrast</title><link>https://modern-css.com/high-contrast-support-without-broken-ui/</link><guid isPermaLink="true">https://modern-css.com/high-contrast-support-without-broken-ui/</guid><description>Style for Windows High Contrast and forced color modes with the forced-colors media query and system color keywords. Stops custom backgrounds and shadows from hiding interactive elements.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS text-box-trim and text-box-edge for cap-height centering</title><link>https://modern-css.com/centering-button-text-without-line-height-tweaks/</link><guid isPermaLink="true">https://modern-css.com/centering-button-text-without-line-height-tweaks/</guid><description>Center button and label text on its cap height with text-box-trim and text-box-edge. Removes the half-leading that throws off vertical alignment, no padding hacks needed.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Larger Touch Targets in CSS Without Changing Element Size</title><link>https://modern-css.com/larger-touch-targets-without-changing-element-size/</link><guid isPermaLink="true">https://modern-css.com/larger-touch-targets-without-changing-element-size/</guid><description>Expand touch targets for mobile without affecting visual layout. Use ::after with position: absolute and @media (pointer: coarse) to grow the hit area invisibly.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Floating Labels with :placeholder-shown</title><link>https://modern-css.com/floating-labels-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/floating-labels-without-javascript/</guid><description>Float labels above filled inputs with :placeholder-shown. No JavaScript input listener or .filled class toggle required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS :playing, :paused, :muted Pseudo-Classes for Media</title><link>https://modern-css.com/video-player-states-without-javascript-events/</link><guid isPermaLink="true">https://modern-css.com/video-player-states-without-javascript-events/</guid><description>Style video and audio by playback state with the CSS :playing, :paused, :muted, :seeking, :buffering, and :stalled pseudo-classes. No JavaScript event listeners.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Custom Highlight API: ::highlight() Pseudo-Element</title><link>https://modern-css.com/text-highlighting-without-dom-manipulation/</link><guid isPermaLink="true">https://modern-css.com/text-highlighting-without-dom-manipulation/</guid><description>Highlight arbitrary text ranges with the CSS Custom Highlight API and ::highlight(). No wrapping spans in innerHTML or breaking the DOM with surroundContents().</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS shape() Function: Responsive clip-path Shapes</title><link>https://modern-css.com/path-shapes-without-svg-clip-paths/</link><guid isPermaLink="true">https://modern-css.com/path-shapes-without-svg-clip-paths/</guid><description>Create responsive clip-path shapes with the CSS shape() function. Uses percentage units instead of SVG clipPath or path() values that break on resize.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS random() Function for Per-Element Random Values</title><link>https://modern-css.com/random-values-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/random-values-without-javascript/</guid><description>Generate per-element random values with the CSS random(min, max) function. No JavaScript Math.random() or inline style attributes. All in CSS.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Data-Driven CSS Layouts with Typed attr()</title><link>https://modern-css.com/attr-driven-layouts-without-js-charts/</link><guid isPermaLink="true">https://modern-css.com/attr-driven-layouts-without-js-charts/</guid><description>Build data-driven CSS layouts by reading typed attr() values from data attributes. Size bars and cards directly in CSS with no JavaScript chart library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Automatic CSS Type Scale with sibling-index() and pow()</title><link>https://modern-css.com/automatic-type-scale-without-manual-sizes/</link><guid isPermaLink="true">https://modern-css.com/automatic-type-scale-without-manual-sizes/</guid><description>Build an automatic CSS type scale using :heading(), sibling-index(), and pow(). Heading sizes derive from document structure, no hardcoded font-size ladder.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS zoom Property vs transform: scale()</title><link>https://modern-css.com/scaling-elements-without-transform-hacks/</link><guid isPermaLink="true">https://modern-css.com/scaling-elements-without-transform-hacks/</guid><description>Scale elements with the CSS zoom property instead of transform: scale() plus negative margins. zoom shrinks the element and its layout footprint together.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS contrast-color() for Readable Text</title><link>https://modern-css.com/readable-text-without-manual-contrast-checks/</link><guid isPermaLink="true">https://modern-css.com/readable-text-without-manual-contrast-checks/</guid><description>Auto-pick readable text color based on background luminance with CSS contrast-color(). Returns whichever meets WCAG AA contrast, black or white, per background.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>OKLCH Color in CSS: Perceptually Uniform Colors</title><link>https://modern-css.com/perceptually-uniform-colors-with-oklch/</link><guid isPermaLink="true">https://modern-css.com/perceptually-uniform-colors-with-oklch/</guid><description>Define CSS colors with oklch for perceptually uniform lightness across hues. Yellow and blue at the same L look equally bright. Build palettes by changing one value.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Frosted Glass Effect in CSS with backdrop-filter</title><link>https://modern-css.com/frosted-glass-effect-without-opacity-hacks/</link><guid isPermaLink="true">https://modern-css.com/frosted-glass-effect-without-opacity-hacks/</guid><description>Create a frosted glass effect in CSS with backdrop-filter: blur(). No pseudo-element background copy, filter stacking, or z-index positioning hacks.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Motion Path Animation with offset-path</title><link>https://modern-css.com/motion-path-animation-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/motion-path-animation-without-javascript/</guid><description>Animate elements along a curved motion path in CSS with offset-path and offset-distance. Replaces GSAP motionPath or manual JavaScript coordinate loops.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>HTML inputmode and enterkeyhint for Mobile Keyboards</title><link>https://modern-css.com/mobile-keyboard-hints-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/mobile-keyboard-hints-without-javascript/</guid><description>Show the right mobile keyboard with the inputmode attribute. Relabel the return key with enterkeyhint. No JavaScript user-agent detection or keyboard library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>HTML output Element for Live Form Output</title><link>https://modern-css.com/live-form-output-without-javascript-dom-writes/</link><guid isPermaLink="true">https://modern-css.com/live-form-output-without-javascript-dom-writes/</guid><description>Display live form output with the HTML output element. Connects directly to form inputs. No querySelector, textContent writes, or input event listeners.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Lazy Load Images in HTML with loading=&quot;lazy&quot;</title><link>https://modern-css.com/lazy-load-images-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/lazy-load-images-without-javascript/</guid><description>Lazy load images in HTML with the loading=&quot;lazy&quot; attribute. No IntersectionObserver, no scroll listener, no image lazy-loading JavaScript library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Accordion with details and summary (No JavaScript)</title><link>https://modern-css.com/accordion-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/accordion-without-javascript/</guid><description>Build a CSS accordion with the native details and summary elements. No JavaScript click handlers, no aria toggling, accessible by default.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>HTML datalist: Native Autocomplete (No JavaScript)</title><link>https://modern-css.com/native-autocomplete-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/native-autocomplete-without-javascript/</guid><description>Add native HTML autocomplete to any input with the datalist element. No Typeahead, Awesomplete, or custom dropdown autocomplete JavaScript library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Prevent Scrollbar Layout Shift: scrollbar-gutter: stable</title><link>https://modern-css.com/preventing-layout-shift-from-scrollbar/</link><guid isPermaLink="true">https://modern-css.com/preventing-layout-shift-from-scrollbar/</guid><description>Prevent scrollbar layout shift with scrollbar-gutter: stable. Reserves space before the scrollbar appears. No overflow-y: scroll or hardcoded padding-right.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS overscroll-behavior: contain (No JavaScript)</title><link>https://modern-css.com/preventing-scroll-chaining-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/preventing-scroll-chaining-without-javascript/</guid><description>Stop scroll from leaking out of modals and dropdowns with CSS overscroll-behavior: contain. No JavaScript wheel event listener or preventDefault() call.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Style Scrollbars in CSS: scrollbar-color, scrollbar-width</title><link>https://modern-css.com/scrollbar-styling-without-webkit-pseudo-elements/</link><guid isPermaLink="true">https://modern-css.com/scrollbar-styling-without-webkit-pseudo-elements/</guid><description>Style scrollbars in CSS with scrollbar-color and scrollbar-width. Standard properties that work in Firefox, not just the non-standard ::-webkit-scrollbar.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS dvh, svh, lvh: Mobile Viewport Height Fix</title><link>https://modern-css.com/mobile-viewport-height-without-100vh-hack/</link><guid isPermaLink="true">https://modern-css.com/mobile-viewport-height-without-100vh-hack/</guid><description>Fix the 100vh mobile overflow with dynamic viewport units. dvh, svh, and lvh adapt to the visible area as browser chrome appears and disappears.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS prefers-reduced-motion Media Query</title><link>https://modern-css.com/reduced-motion-without-javascript-detection/</link><guid isPermaLink="true">https://modern-css.com/reduced-motion-without-javascript-detection/</guid><description>Respect the user&apos;s prefers-reduced-motion setting in CSS. Disable or reduce animations for users with the OS-level preference. No JavaScript matchMedia check.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Feature Detection with @supports (No Modernizr)</title><link>https://modern-css.com/css-feature-detection-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/css-feature-detection-without-javascript/</guid><description>Detect CSS feature support with @supports instead of JavaScript CSS.supports() checks or Modernizr. Apply styles only when a property is supported.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Exclusive Accordion with the details name Attribute</title><link>https://modern-css.com/exclusive-accordions-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/exclusive-accordions-without-javascript/</guid><description>Build an exclusive CSS accordion where only one panel opens at a time using the details name attribute. No JavaScript toggle event listeners needed.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Custom CSS Easing with linear() Timing Function</title><link>https://modern-css.com/custom-easing-without-cubic-bezier-guessing/</link><guid isPermaLink="true">https://modern-css.com/custom-easing-without-cubic-bezier-guessing/</guid><description>Define bounce, spring, and elastic easing curves with the CSS linear() timing function. No cubic-bezier guessing or GSAP animation library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Media Query Range Syntax (width &lt; 768px)</title><link>https://modern-css.com/media-query-ranges-without-min-max-syntax/</link><guid isPermaLink="true">https://modern-css.com/media-query-ranges-without-min-max-syntax/</guid><description>Write CSS media query ranges with comparison operators like (width &lt; 768px) instead of min-width and max-width. Supports compound ranges in one query.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Responsive Images in CSS with object-fit: cover</title><link>https://modern-css.com/responsive-images-without-background-image-hack/</link><guid isPermaLink="true">https://modern-css.com/responsive-images-without-background-image-hack/</guid><description>Use object-fit: cover on img elements for responsive images. Semantic HTML, native lazy loading, and alt text. No background-image hack on empty divs.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Form Validation Styles with :user-invalid</title><link>https://modern-css.com/form-validation-styles-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/form-validation-styles-without-javascript/</guid><description>Show CSS form validation styles only after the user interacts using :user-invalid. No JavaScript .touched class or blur event listener required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Auto-Resize Textarea in CSS: field-sizing: content</title><link>https://modern-css.com/auto-growing-textarea-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/auto-growing-textarea-without-javascript/</guid><description>Auto-resize a textarea in CSS with field-sizing: content. The textarea grows with its content. No JavaScript oninput or scrollHeight measuring.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Animate height: auto in CSS with interpolate-size</title><link>https://modern-css.com/smooth-height-auto-animations-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/smooth-height-auto-animations-without-javascript/</guid><description>Animate height to and from auto in CSS with interpolate-size: allow-keywords. No JavaScript measuring scrollHeight or fixed pixel transitions.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Range Style Queries: style(--progress &gt; 50%)</title><link>https://modern-css.com/range-style-queries-without-multiple-blocks/</link><guid isPermaLink="true">https://modern-css.com/range-style-queries-without-multiple-blocks/</guid><description>Write range comparisons in CSS style queries directly, like style(--progress &gt; 50%). No multiple @container style() blocks or JavaScript comparisons.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS scroll-state() Container Queries: :stuck and :snapped</title><link>https://modern-css.com/sticky-snapped-styling-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/sticky-snapped-styling-without-javascript/</guid><description>Style sticky and snapped elements with CSS scroll-state() container queries. Detect :stuck and :snapped states without JavaScript scroll event listeners.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS attr() with Type: Typed HTML Attribute Values</title><link>https://modern-css.com/typed-attribute-values-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/typed-attribute-values-without-javascript/</guid><description>Read HTML attribute values as typed CSS data with advanced attr(). Supports numbers, colors, and lengths directly, no JavaScript dataset access or inline styles.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS if() Function for Inline Conditional Styles</title><link>https://modern-css.com/inline-conditional-styles-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/inline-conditional-styles-without-javascript/</guid><description>Write inline conditional styles with the CSS if() function. Responds to custom properties, media features, and container queries. No JavaScript class toggling.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS @function for Reusable Logic (No Sass Mixins)</title><link>https://modern-css.com/reusable-css-logic-without-sass-mixins/</link><guid isPermaLink="true">https://modern-css.com/reusable-css-logic-without-sass-mixins/</guid><description>Define reusable CSS logic with the native @function at-rule. Returns computed values, runs in the browser. Replaces Sass mixins and preprocessor functions.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS corner-shape: Squircle, Scoop, and Notch Corners</title><link>https://modern-css.com/corner-shapes-beyond-rounded-borders/</link><guid isPermaLink="true">https://modern-css.com/corner-shapes-beyond-rounded-borders/</guid><description>Create squircle, scoop, and notch corners with CSS corner-shape instead of clip-path polygon hacks or SVG masks. Modern CSS corner shapes.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Responsive CSS clip-path with the shape() Function</title><link>https://modern-css.com/responsive-clip-paths-without-svg/</link><guid isPermaLink="true">https://modern-css.com/responsive-clip-paths-without-svg/</guid><description>Create responsive CSS clip-path shapes with the shape() function. Uses percentages and viewport units. No SVG path() definitions with fixed pixel coordinates.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Scroll Spy with :target-current (No IntersectionObserver)</title><link>https://modern-css.com/scroll-spy-without-intersection-observer/</link><guid isPermaLink="true">https://modern-css.com/scroll-spy-without-intersection-observer/</guid><description>Highlight the current section with a CSS scroll spy using scroll-target-group and :target-current. No JavaScript IntersectionObserver or scroll event listener.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Fill Available Space in CSS with the stretch Keyword</title><link>https://modern-css.com/filling-available-space-without-calc-workarounds/</link><guid isPermaLink="true">https://modern-css.com/filling-available-space-without-calc-workarounds/</guid><description>Fill available space in CSS with width: stretch or height: stretch. No calc(100% minus margins) workarounds or width: 100% overflow issues.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Staggered CSS Animations with sibling-index()</title><link>https://modern-css.com/staggered-animations-without-nth-child-hacks/</link><guid isPermaLink="true">https://modern-css.com/staggered-animations-without-nth-child-hacks/</guid><description>Create staggered CSS animation delays with the sibling-index() function. No hardcoded --index on every :nth-child or JavaScript counting loop.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS-Only Carousel Navigation with scroll-marker</title><link>https://modern-css.com/carousel-navigation-without-a-javascript-library/</link><guid isPermaLink="true">https://modern-css.com/carousel-navigation-without-a-javascript-library/</guid><description>Build CSS-only carousel navigation with the scroll-button and scroll-marker pseudo-elements. No Swiper.js, Slick, or JavaScript carousel library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Vertically Center Text in CSS with text-box-trim</title><link>https://modern-css.com/vertical-text-centering-without-padding-hacks/</link><guid isPermaLink="true">https://modern-css.com/vertical-text-centering-without-padding-hacks/</guid><description>Vertically center text in CSS with text-box-trim and text-box-edge. Trims invisible font metric space for true optical centering. No padding or line-height tricks.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Hover Tooltips with popover=hint and interestfor</title><link>https://modern-css.com/hover-tooltips-without-javascript-events/</link><guid isPermaLink="true">https://modern-css.com/hover-tooltips-without-javascript-events/</guid><description>Show CSS hover tooltips with popover=hint and the interestfor attribute. No JavaScript mouseenter or mouseleave event listeners required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Modal Controls with commandfor and command Attributes</title><link>https://modern-css.com/modal-controls-without-onclick-handlers/</link><guid isPermaLink="true">https://modern-css.com/modal-controls-without-onclick-handlers/</guid><description>Open and close CSS modal dialogs with the commandfor and command attributes on a button. No onclick handlers or showModal() JavaScript call needed.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Dialog Light Dismiss with closedby Attribute</title><link>https://modern-css.com/dialog-light-dismiss-without-click-outside-listeners/</link><guid isPermaLink="true">https://modern-css.com/dialog-light-dismiss-without-click-outside-listeners/</guid><description>Close a CSS dialog on outside click or ESC with the closedby attribute. No JavaScript click-outside listener or backdrop event handlers needed.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Customizable CSS Select with appearance: base-select</title><link>https://modern-css.com/customizable-selects-without-a-javascript-library/</link><guid isPermaLink="true">https://modern-css.com/customizable-selects-without-a-javascript-library/</guid><description>Customize a native HTML select dropdown with appearance: base-select. Replaces Select2, Choices.js, and other JavaScript select libraries.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Wide-Gamut Color: display-p3 and rec2020</title><link>https://modern-css.com/vivid-colors-beyond-srgb/</link><guid isPermaLink="true">https://modern-css.com/vivid-colors-beyond-srgb/</guid><description>Use CSS wide-gamut color with oklch, display-p3, and rec2020. Vivid colors that pop on P3 displays instead of staying in the sRGB box like hex, rgb(), or hsl().</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Relative Color Syntax: Lighten, Darken Without Sass</title><link>https://modern-css.com/color-variants-without-sass-functions/</link><guid isPermaLink="true">https://modern-css.com/color-variants-without-sass-functions/</guid><description>Derive lighter and darker color variants at runtime with CSS relative color syntax. Replaces Sass lighten(), darken(), and saturate() functions.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Truncate Text to N Lines in CSS with line-clamp</title><link>https://modern-css.com/multiline-text-truncation-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/multiline-text-truncation-without-javascript/</guid><description>Truncate multiline text in CSS with line-clamp. Cleaner than the -webkit-line-clamp plus -webkit-box-orient hack and no JavaScript character counting.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Drop Caps with the initial-letter Property</title><link>https://modern-css.com/drop-caps-without-float-hacks/</link><guid isPermaLink="true">https://modern-css.com/drop-caps-without-float-hacks/</guid><description>Create CSS drop caps with the initial-letter property. No float, font-size, line-height, or margin hacks. One property handles baseline alignment.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS inset Shorthand for top, right, bottom, left</title><link>https://modern-css.com/positioning-shorthand-without-four-properties/</link><guid isPermaLink="true">https://modern-css.com/positioning-shorthand-without-four-properties/</guid><description>Use the CSS inset shorthand to set top, right, bottom, and left in one declaration. Cleaner than four separate properties for full-bleed and overlay layouts.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Lazy Rendering with content-visibility: auto</title><link>https://modern-css.com/lazy-rendering-without-intersection-observer/</link><guid isPermaLink="true">https://modern-css.com/lazy-rendering-without-intersection-observer/</guid><description>Enable CSS lazy rendering with content-visibility: auto. Skip offscreen rendering with one property instead of JavaScript IntersectionObserver.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS-Only Dropdown Menu with the Popover API</title><link>https://modern-css.com/dropdown-menus-without-javascript-toggles/</link><guid isPermaLink="true">https://modern-css.com/dropdown-menus-without-javascript-toggles/</guid><description>Build a CSS-only dropdown menu with the popover attribute and popovertarget. No JavaScript toggle, click-outside, or ESC key handler required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Anchor Positioning for Tooltips</title><link>https://modern-css.com/tooltip-positioning-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/tooltip-positioning-without-javascript/</guid><description>Position tooltips with CSS anchor positioning: anchor-name and position-anchor. No Popper.js, Floating UI, or JavaScript position calculation library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS @scope: Scoped Styles Without BEM</title><link>https://modern-css.com/scoped-styles-without-bem-naming/</link><guid isPermaLink="true">https://modern-css.com/scoped-styles-without-bem-naming/</guid><description>Scope CSS styles to a component with @scope (.card) { }. No BEM naming, CSS Modules, or styled-components. Native CSS scoping inside the cascade.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS @property for Typed Custom Properties</title><link>https://modern-css.com/typed-custom-properties-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/typed-custom-properties-without-javascript/</guid><description>Define typed CSS custom properties with @property. Set syntax, inherits, and initial-value so the browser can animate and interpolate custom properties.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Individual Transform Properties: translate, rotate, scale</title><link>https://modern-css.com/independent-transforms-without-the-shorthand/</link><guid isPermaLink="true">https://modern-css.com/independent-transforms-without-the-shorthand/</guid><description>Animate CSS translate, rotate, and scale as individual transform properties. No more rewriting the full transform shorthand to change one value.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Animate display: none in CSS (No JavaScript)</title><link>https://modern-css.com/animating-display-none-without-workarounds/</link><guid isPermaLink="true">https://modern-css.com/animating-display-none-without-workarounds/</guid><description>Animate display: none in CSS with transition-behavior: allow-discrete. No JavaScript transitionend listeners or visibility plus opacity hacks.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Entry Animations with @starting-style</title><link>https://modern-css.com/entry-animations-without-javascript-timing/</link><guid isPermaLink="true">https://modern-css.com/entry-animations-without-javascript-timing/</guid><description>Animate elements when they enter the DOM with CSS @starting-style. No JavaScript requestAnimationFrame or setTimeout to add a class after paint.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS View Transitions API (No Framework)</title><link>https://modern-css.com/page-transitions-without-a-framework/</link><guid isPermaLink="true">https://modern-css.com/page-transitions-without-a-framework/</guid><description>Build smooth CSS page transitions with the View Transitions API. One JavaScript call plus view-transition-name in CSS. No Barba.js or React Transition Group.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Scroll Snap: scroll-snap-type and scroll-snap-align</title><link>https://modern-css.com/scroll-snapping-without-a-carousel-library/</link><guid isPermaLink="true">https://modern-css.com/scroll-snapping-without-a-carousel-library/</guid><description>Build horizontal CSS scroll snap carousels with scroll-snap-type and scroll-snap-align. No Slick, Swiper, or custom JavaScript touch and scroll math.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Balance Headlines in CSS with text-wrap: balance</title><link>https://modern-css.com/balanced-headlines-without-manual-line-breaks/</link><guid isPermaLink="true">https://modern-css.com/balanced-headlines-without-manual-line-breaks/</guid><description>Balance headlines in CSS with text-wrap: balance. Even line breaks on headings without manual br tags or the Balance-Text JavaScript library.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>font-display: swap in CSS (Prevent Invisible Text)</title><link>https://modern-css.com/font-loading-without-invisible-text/</link><guid isPermaLink="true">https://modern-css.com/font-loading-without-invisible-text/</guid><description>Prevent invisible text during font load with font-display: swap in @font-face. Fallback text shows immediately, then swaps when the custom font is ready.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Variable Fonts in CSS: One File, All Weights</title><link>https://modern-css.com/multiple-font-weights-without-multiple-files/</link><guid isPermaLink="true">https://modern-css.com/multiple-font-weights-without-multiple-files/</guid><description>Use variable fonts in CSS to ship one font file that covers font-weight 100 to 900. Replaces four or more @font-face declarations and HTTP requests.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Dark Mode with color-scheme: light dark</title><link>https://modern-css.com/dark-mode-defaults-without-extra-css/</link><guid isPermaLink="true">https://modern-css.com/dark-mode-defaults-without-extra-css/</guid><description>Enable CSS dark mode with color-scheme: light dark so the browser styles form controls, scrollbars, and backgrounds automatically. No extra CSS required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Dark Mode Colors in CSS with light-dark()</title><link>https://modern-css.com/dark-mode-colors-without-duplicating-values/</link><guid isPermaLink="true">https://modern-css.com/dark-mode-colors-without-duplicating-values/</guid><description>Set dark mode colors in CSS with the light-dark() function. One declaration holds both light and dark values, no duplicate variables or media query.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Low-Specificity CSS Reset with :where()</title><link>https://modern-css.com/low-specificity-resets-without-complicated-selectors/</link><guid isPermaLink="true">https://modern-css.com/low-specificity-resets-without-complicated-selectors/</guid><description>Write a low-specificity CSS reset with :where() so base styles never override your component styles. Zero specificity, no fighting the cascade.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Logical Properties: RTL Layouts Without left and right</title><link>https://modern-css.com/direction-aware-layouts-without-left-and-right/</link><guid isPermaLink="true">https://modern-css.com/direction-aware-layouts-without-left-and-right/</guid><description>Build direction-aware CSS layouts with logical properties like margin-inline-start and padding-block-end. One set of rules works for LTR and RTL.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS grid-template-areas: Named Grid Areas</title><link>https://modern-css.com/naming-grid-areas-without-line-numbers/</link><guid isPermaLink="true">https://modern-css.com/naming-grid-areas-without-line-numbers/</guid><description>Define CSS grid-template-areas with named regions like header, sidebar, and main. Cleaner than grid-column and grid-row line numbers or float-based layouts.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Subgrid: Align Nested Grids Without Duplicating Tracks</title><link>https://modern-css.com/aligning-nested-grids-without-duplicating-tracks/</link><guid isPermaLink="true">https://modern-css.com/aligning-nested-grids-without-duplicating-tracks/</guid><description>Align nested CSS grids with grid-template-columns: subgrid so inner grids inherit the parent&apos;s tracks instead of duplicating them.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Modal Dialog with the Native dialog Element</title><link>https://modern-css.com/modal-dialogs-without-a-javascript-library/</link><guid isPermaLink="true">https://modern-css.com/modal-dialogs-without-a-javascript-library/</guid><description>Build a CSS modal dialog with the native dialog element and showModal(). Handles ESC, focus trap, and z-index. No modal JavaScript library required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS accent-color for Checkboxes, Radios, and Range Inputs</title><link>https://modern-css.com/styling-form-controls-without-rebuilding-them/</link><guid isPermaLink="true">https://modern-css.com/styling-form-controls-without-rebuilding-them/</guid><description>Tint checkboxes, radios, and range inputs with the CSS accent-color property. One line instead of appearance: none and rebuilding the control with custom markup.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Group CSS Selectors with :is() and :where()</title><link>https://modern-css.com/grouping-selectors-without-repetition/</link><guid isPermaLink="true">https://modern-css.com/grouping-selectors-without-repetition/</guid><description>Group CSS selectors with :is() and :where() to avoid repeating the same prefix. Shorter stylesheets, easier maintenance, no duplicate selector lists.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Focus Styles with :focus-visible</title><link>https://modern-css.com/focus-styles-without-annoying-mouse-users/</link><guid isPermaLink="true">https://modern-css.com/focus-styles-without-annoying-mouse-users/</guid><description>Show CSS focus styles only for keyboard users with :focus-visible. Mouse clicks do not trigger the outline. Accessible focus without visual noise.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Control CSS Specificity with @layer (No !important)</title><link>https://modern-css.com/controlling-specificity-without-important/</link><guid isPermaLink="true">https://modern-css.com/controlling-specificity-without-important/</guid><description>Control CSS specificity with @layer to order base, components, and utilities. Stop the !important arms race. Cascade layers handle it natively.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Custom Properties for Theme Variables</title><link>https://modern-css.com/theme-variables-without-a-preprocessor/</link><guid isPermaLink="true">https://modern-css.com/theme-variables-without-a-preprocessor/</guid><description>Use CSS custom properties for theme variables. Colors, spacing, and typography update at runtime. No Sass, Less, or other preprocessor compile step required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Fluid Typography in CSS with clamp()</title><link>https://modern-css.com/fluid-typography-without-media-queries/</link><guid isPermaLink="true">https://modern-css.com/fluid-typography-without-media-queries/</guid><description>Build fluid typography in CSS with clamp() for responsive font sizes. One function scales between a min and max. No media query breakpoint ladder.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS gap Property for Flex and Grid Spacing</title><link>https://modern-css.com/spacing-elements-without-margin-hacks/</link><guid isPermaLink="true">https://modern-css.com/spacing-elements-without-margin-hacks/</guid><description>Space flex and grid children with the CSS gap property. Cleaner than margin on every child plus :last-child overrides or negative margin on the container.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS aspect-ratio Property (No Padding Hack)</title><link>https://modern-css.com/aspect-ratios-without-the-padding-hack/</link><guid isPermaLink="true">https://modern-css.com/aspect-ratios-without-the-padding-hack/</guid><description>Lock a 16:9 or any aspect ratio in CSS with the aspect-ratio property. No padding-top percentage trick or absolute positioning required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS Sticky Header with position: sticky</title><link>https://modern-css.com/sticky-headers-without-javascript-scroll-listeners/</link><guid isPermaLink="true">https://modern-css.com/sticky-headers-without-javascript-scroll-listeners/</guid><description>Build a CSS sticky header with position: sticky in one property. No JavaScript scroll event listener, getBoundingClientRect(), or sticky class toggle.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Scroll-Driven Animations in CSS with scroll-timeline</title><link>https://modern-css.com/scroll-linked-animations-without-a-library/</link><guid isPermaLink="true">https://modern-css.com/scroll-linked-animations-without-a-library/</guid><description>Build scroll-driven animations in CSS with animation-timeline and scroll-timeline. No IntersectionObserver, GSAP, or AOS.js scroll animation library required.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Native CSS Nesting (No Sass or Less)</title><link>https://modern-css.com/nesting-selectors-without-sass-or-less/</link><guid isPermaLink="true">https://modern-css.com/nesting-selectors-without-sass-or-less/</guid><description>Use native CSS nesting with the &amp; selector. Same syntax as Sass or Less nesting, no preprocessor or build step required. Baseline 2023.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Center a Div with Flexbox justify-content and align-items</title><link>https://modern-css.com/centering-elements-with-flexbox/</link><guid isPermaLink="true">https://modern-css.com/centering-elements-with-flexbox/</guid><description>Center a div using display: flex with justify-content: center and align-items: center. Alternative to grid place-items with different overflow behavior.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Responsive Components with CSS Container Queries</title><link>https://modern-css.com/responsive-components-without-media-queries/</link><guid isPermaLink="true">https://modern-css.com/responsive-components-without-media-queries/</guid><description>Build responsive components with CSS @container queries. Components respond to their parent container&apos;s size, not the viewport. Replaces @media breakpoints.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Center with margin: auto in CSS Grid</title><link>https://modern-css.com/centering-elements-with-auto-margins/</link><guid isPermaLink="true">https://modern-css.com/centering-elements-with-auto-margins/</guid><description>Center a div in a grid container using margin: auto. A single property alternative to place-items when you need different row/column behavior.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS color-mix() Function (No Sass Required)</title><link>https://modern-css.com/mixing-colors-without-a-preprocessor/</link><guid isPermaLink="true">https://modern-css.com/mixing-colors-without-a-preprocessor/</guid><description>Mix colors in CSS with the color-mix() function. Works with oklch, srgb, and hsl. Replaces Sass mix() without a preprocessor or JavaScript color utility.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>CSS :has() Selector: Select Parent by Child</title><link>https://modern-css.com/selecting-parent-elements-without-javascript/</link><guid isPermaLink="true">https://modern-css.com/selecting-parent-elements-without-javascript/</guid><description>Select parent elements based on their children with the CSS :has() pseudo-class. No JavaScript walking the DOM or closest() calls. Pure CSS parent selection.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item><item><title>Center a Div in CSS with place-items: center</title><link>https://modern-css.com/centering-elements-without-the-transform-hack/</link><guid isPermaLink="true">https://modern-css.com/centering-elements-without-the-transform-hack/</guid><description>Center a div in CSS with display: grid and place-items: center. Two properties on the parent instead of position: absolute and transform: translate.</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate></item></channel></rss>