Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 13, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 13, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 13, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 13, 2025

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025

      Microsoft shares rare look at radical Windows 11 Start menu designs it explored before settling on the least interesting one of the bunch

      May 13, 2025

      NVIDIA’s new GPU driver adds DOOM: The Dark Ages support and improves DLSS in Microsoft Flight Simulator 2024

      May 13, 2025

      How to install and use Ollama to run AI LLMs on your Windows 11 PC

      May 13, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Community News: Latest PECL Releases (05.13.2025)

      May 13, 2025
      Recent

      Community News: Latest PECL Releases (05.13.2025)

      May 13, 2025

      How We Use Epic Branches. Without Breaking Our Flow.

      May 13, 2025

      I think the ergonomics of generators is growing on me.

      May 13, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025
      Recent

      This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

      May 13, 2025

      Microsoft shares rare look at radical Windows 11 Start menu designs it explored before settling on the least interesting one of the bunch

      May 13, 2025

      NVIDIA’s new GPU driver adds DOOM: The Dark Ages support and improves DLSS in Microsoft Flight Simulator 2024

      May 13, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»Support Logical Shorthands in CSS

    Support Logical Shorthands in CSS

    March 24, 2025

    There’s a bit of a blind spot when working with CSS logical properties concerning shorthands. Miriam explains:

    Logical properties are a great way to optimize our sites in advance, without any real effort.

    But what if we want to set multiple properties at once? This is where shorthands like margin and padding become useful. But they are currently limited to setting physical dimension. Logical properties are great, but they still feel like a second-class feature of the language.

    There are a few 2-value shorthands that have been implemented, like margin-block for setting both the -block-start and -block-endmargins. I find those extremely useful and concise. But the existing 4-value shorthands feel stuck in the past. It’s surprising that a size shorthand can’t set the inline-size, and the inset shorthand doesn’t include inset-block-start. Is there any way to update those shorthand properties so that they can be used to set logical dimensions?

    She ends with the money question, whether we can do anything about it. We’re currently in a position of having to choose between supporting flow-relative terms like block-start and inline-start with longhand properties and the ergonomic benefits of writing shorthand properties that are evaluated as physical terms like top, bottom, left, and right. Those of us writing CSS for a while likely have the muscle memory to adapt accordingly, but it’s otherwise a decision that has real consequences, particularly for multi-lingual sites.

    Note that Miriam says this is something the CSS Working Group has been working on since 2017. And there’s a little momentum to pick it up and do something about it. The first thing you can do is support Miriam’s work — everything she does with the CSS Working Group (and it’s a lot) is a labor of love and relies on sponsorships, so chipping in is one way to push things forward.

    The other thing you can do is chime into Miriam’s proposal that she published in 2021. I think it’s a solid idea. We can’t simply switch from physical to flow-relative terms in shorthand properties without triggering compatibility issues, so having some sort of higher-level instruction for CSS at the top of the stylesheet, perhaps as an at-rule that specifies which “mode” we’re in.

    <coordinate-mode> = [ logical | physical ] or [ relative | absolute ] or ...
    
    @mode <coordinate-mode>; /* must come after @import and before any style rules */
    
    @mode <coordinate-mode> { <stylesheet> }
    
    selector {
      property: value  !<coordinate-mode>;
    }

    Perhaps naming aside, it seems pretty reasonable, eh?


    Support Logical Shorthands in CSS originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDOJ demands divestiture of Chrome browser and sets sights on making Google sell Android — calls Google “incompatible with free markets and freedom”
    Next Article Best Free and Open Source Alternatives to Apple iMovie

    Related Posts

    News & Updates

    This $4 Steam Deck game includes the most-played classics from my childhood — and it will save you paper

    May 13, 2025
    News & Updates

    Microsoft shares rare look at radical Windows 11 Start menu designs it explored before settling on the least interesting one of the bunch

    May 13, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    SideWinder APT Targets Maritime, Nuclear, and IT Sectors Across Asia, Middle East, and Africa

    Development

    New ‘Cuckoo’ Persistent macOS Spyware Targeting Intel and Arm Macs

    Development

    Is Multimodal AI in Finance the Next Strategic Move for Growth?

    Development

    AI Hallucinations: What Designers Need to Know

    Web Development

    Highlights

    Distribution Release: Ubuntu 24.04.2

    February 20, 2025

    The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. Florent Jacquet has announced the release of Ubuntu 24.04.2, a minor update to the 24.04 LTS series: “The Ubuntu team is pleased to announce the release of Ubuntu 24.04.2 LTS (Long-Term Support) for its Desktop, Server, and Cloud products, as well as other flavours of Ubuntu with long-term….

    Spotify increases its prices again. Is it enough for you to switch?

    June 3, 2024

    CVE-2025-39588 – Ultimate Store Kit Elementor Addons Untrusted Data Deserialization Object Injection

    April 20, 2025

    Tiny Models, Big Reasoning Gains: USC Researchers Introduce Tina for Cost-Effective Reinforcement Learning with LoRA

    April 28, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.