Re: Proposal for Updating the @support Rule in CSS

Hello Izzaque

Would you be able to share your proposal on our GitHub issues so that it can be seen more widely?

But before that, I would encourage you to check out the proposed new @when and @else at-rules, which may already do what you want. https://www.w3.org/TR/css-conditional-5/#at-ruledef-else

Kind regards,
Josh

—
Josh Tumath (he/him)
Senior Software Engineer, WebCore Design System, Channels & Product Excellence
BBC Product Group

From: 488269508@qq.com <488269508@qq.com>
Date: Tuesday, 7 January 2025 at 05:16
To: www-style@w3.org <www-style@w3.org>
Subject: Proposal for Updating the @support Rule in CSS

External: Think before clicking
Dear W3C,
I am writing to you with a proposal regarding the @support rule in CSS.
As we all know, with the continuous improvement of CSS standards, the @support rule is in urgent need of an update. In the existing @support rule, it can only check whether a single statement is valid. I have a new design concept in mind.
I suggest a new structure like this:
@support(true) {
    /* Statements to be checked. If the check passes, they will be implemented. */
    @catch {
        /* Fallback version */
    }
}
This new design, if implemented, would bring more flexibility for front - end developers. It would enable us to handle style compatibility and progressive enhancement in a more effective way. We could better adapt to different browser environments and user experiences.
I hope that the W3C could consider this proposal and start relevant discussions within the community. Thank you very much for your attention to this matter.
Best regards,
izzaque

Received on Tuesday, 7 January 2025 10:32:36 UTC