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

Invalid CSS generated by Tailwind plugin #2454

Open
maneac opened this issue Jan 31, 2024 · 1 comment
Open

Invalid CSS generated by Tailwind plugin #2454

maneac opened this issue Jan 31, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@maneac
Copy link

maneac commented Jan 31, 2024

Current Behavior

Hi,

I'm trying to integrate Skeleton into a project that uses LightningCSS to process the final CSS output.
However, its strict CSS checking is unhappy with some of the generated selectors.

After a little digging, I believe the CSS generator is producing invalid selector(s):

input[type='file']:not(.file-dropzone-input)::file-selector-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

Expected Behavior

These selectors should be generated as:

input[type='file']:not(.file-dropzone-input):disabled::file-selector-button {
  cursor: not-allowed;
  opacity: 0.5;
}

, based on the output from: https://play.tailwindcss.com/Icfyn4ryjG.

Steps To Reproduce

Partial reproduction:

  1. Run pnpm -r build:jss on a clean copy of this repository
  2. Inspect packages/plugin/src/tailwind/generated/generated-classes.js.
    Full reproduction:

package.json:

{
    "name": "skeleton-issue",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "test": "tailwindcss -i test.css -o test.out.css"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
        "@skeletonlabs/tw-plugin": "^0.3.1",
        "tailwindcss": "^3.4.1"
    }
}

tailwind.config.js:

import { skeleton } from "@skeletonlabs/tw-plugin";

/** @type {import('tailwindcss').Config} */
module.exports = {
  darkMode: "class",
  theme: {
    extend: {},
  },
  plugins: [
    skeleton({
      themes: { preset: ["skeleton"] },
    }),
  ],
};

test.css

@tailwind base;
@tailwind components;

Install, run the test script, and inspect test.out.css (or pass it into LightningCSS as an input).

Link to Reproduction / Stackblitz

No response

More Information

Thank you for producing a great component library!

@maneac maneac added the bug Something isn't working label Jan 31, 2024
@endigo9740
Copy link
Contributor

@maneac we can take a look, but this may be outside our normal scope of coverage and support. Assuming it's just a small change to a single class that we're authoring manually then that's fine, we can update. However, we probably will not touch the generation script until v3 if that's what's required here. So I just want to set expectations.

@endigo9740 endigo9740 added this to the v2.0 milestone Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants