Component generation not 100% compatible to TailwindCSS with leading dashes
See original GitHub issueThere is an issue in DaisyUi where CSS variables are not generated correctly when using DaisyUI as a WindiCSS plugin (it works fine in TailwindUI).
The reason is quite subtle. In WindiCSS the CSS name of the passed Javascripts are run through a function named camelToDash
In Tailwind the same thing happens deep in a third party module postcss-js
The latter converts property names with one starting dash to CSS names with two dashes. The former leaves a single dash in place.
For DaisyUi this means that -TwBgOpacity
in the Javascript object passed to addComponents gets converted to:
--tw-bg-opacity
by Tailwind
and
-tw-bg-opacity
by WindiCSS
I think it would be helpful to make WindiCSS more TailwindUI compatible by using the same dashing conversion.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Component generation not 100% compatible to TailwindCSS ...
works a little different, leading uppercase letters don't get a dash prefix, hence the different output for the browser prefixes.
Read more >Configuration - Tailwind CSS
A guide to configuring and customizing your Tailwind installation.
Read more >Functions & Directives - Tailwind CSS
A reference for the custom functions and directives Tailwind exposes to your CSS.
Read more >Top / Right / Bottom / Left - Tailwind CSS
Top / Right / Bottom / Left. Utilities for controlling the placement of positioned elements.
Read more >Content Configuration - Tailwind CSS
Configuring source paths. Tailwind CSS works by scanning all of your HTML, JavaScript components, and any other template files for class names, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm it works now 😃
Sure, here is a test case:
input:
expected CSS output:
current output: