question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Component generation not 100% compatible to TailwindCSS with leading dashes

See original GitHub issue

There 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gunters63commented, Apr 8, 2021

Can confirm it works now 😃

image

1reaction
gunters63commented, Apr 1, 2021

Sure, here is a test case:

input:

  '.alert': {
    '-TwBgOpacity': '1',
  },

expected CSS output:

.alert {
	--tw-bg-opacity: 1;
}

current output:

.alert {
	-tw-bg-opacity: 1;
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found