Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safelisting negative values with a prefix not working #6861

Closed
leeshadle opened this issue Jan 3, 2022 · 1 comment · Fixed by #7295
Closed

Safelisting negative values with a prefix not working #6861

leeshadle opened this issue Jan 3, 2022 · 1 comment · Fixed by #7295

Comments

@leeshadle
Copy link

leeshadle commented Jan 3, 2022

What version of Tailwind CSS are you using?

v3.0.9

What build tool (or framework if it abstracts the build tool) are you using?

postcss-cli 9.1.0
tailwindcss-cli

What version of Node.js are you using?

v14.16.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://play.tailwindcss.com/lNapHkRIzf?file=config

Describe your issue
Safelisting negative values with a prefix isn't working.

Reproduction URL: https://play.tailwindcss.com/lNapHkRIzf?file=config

Config:

{
  prefix: 'tw-',
  safelist: [
  {
    pattern: /-skew-x-2/,
    variants: ['hover','focus','md','sm','md:hover','sm:hover','md:focus','sm:focus'],
  },
  ],
  theme: {
    extend: {
      // ...
    },
  },
  plugins: [],
}

Generated safelisted CSS ( no negative value utilities get generated ):

.tw-skew-x-2, .hover\:tw-skew-x-2, .focus\:tw-skew-x-2, .sm\:tw-skew-x-2, .sm\:hover\:tw-skew-x-2, .sm\:focus\:tw-skew-x-2, .md\:tw-skew-x-2, .md\:hover\:tw-skew-x-2, .md\:focus\:tw-skew-x-2 {
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.tw-skew-x-2 {
  --tw-skew-x: 2deg;
  transform: var(--tw-transform);
}
.hover\:tw-skew-x-2:hover {
  --tw-skew-x: 2deg;
  transform: var(--tw-transform);
}
.focus\:tw-skew-x-2:focus {
  --tw-skew-x: 2deg;
  transform: var(--tw-transform);
}
@media (min-width: 640px) {

  .sm\:tw-skew-x-2 {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }

  .sm\:hover\:tw-skew-x-2:hover {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }

  .sm\:focus\:tw-skew-x-2:focus {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }
}
@media (min-width: 768px) {

  .md\:tw-skew-x-2 {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }

  .md\:hover\:tw-skew-x-2:hover {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }

  .md\:focus\:tw-skew-x-2:focus {
    --tw-skew-x: 2deg;
    transform: var(--tw-transform);
  }
}
@itsrishabh
Copy link

+1 experiencing a similar issue on the newest update

"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/line-clamp": "^0.3.0",
"@tailwindcss/typography": "^0.5.0",
"@types/tailwindcss": "^3.0.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants