Skip to content

postcss-custom-media v9 not replacing variables #721

Closed
@gpoitch

Description

@gpoitch

Bug description

Since updating to v9+ (9.0.1) postcss-custom-media is not compiling and replacing custom media variables. Have been using v8 for a while with no issue.

Source CSS

@custom-media --tabletUp (min-width: 768px);

@media (--tabletUp) {
  a { color: red; }
}

Expected CSS

@media (min-width: 768px) {
  a { color: red; }
}

Actual CSS

@media (--tabletUp) {
  a { color: red; }
}

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

No response

Debug output

No response

Extra config

Used via webpack:

{
  loader: 'postcss-loader',
  options: {
    postcssOptions: {
      plugins: [postcssCustomMedia(), autoprefixer()]
    }
  }
}

What plugin are you experiencing this issue on?

PostCSS Custom Media Queries

Plugin version

9.0.1

What OS are you experiencing this on?

macOS

Node Version

19.1.0

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions