Skip to content

Replace light-dark @mixin with native light-dark image support #1865

Description

@LeoMcA

light-dark() supports images now - which is the only thing we're using postcss-mixins for.

We should therefore be able to replace our uses of @mixin light-dark with native light-dark(), and remove the postcss plugin, and stylelint overrides (e.g. #1861)

However, currently the postcss-light-dark plugin adds a @supports (color: light-dark(red, red)) block which would expose light-dark(<image>, <image>) on browsers which don't support it.

Setting preserve: false on this plugin will allow us to make the switch now, until postcss-light-dark detects image support and uses an appropriate @support block.

We also need to force the postcss-light-dark plugin on, until upstream supports light-dark(<image>, <image>), otherwise it'll stop transpiling once light-dark(<colour>, <colour>) is Widely Available (and we drop support for Firefox 115).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions