rogden / tailwind-config-viewer

A local UI tool for visualizing your Tailwind CSS configuration file.
2.01k stars 111 forks source link

tailwind config prefix duplicates dashes in CSS class names #14

Closed alesso-x closed 4 years ago

alesso-x commented 4 years ago

Using the prefix from the tailwind docs tw- produces classes with extra dashes. Instead of tw-bg-black, it becomes tw--bg-black.

Screen Shot 2020-10-13 at 10 40 40 PM

I think the fix is to just check if the prefix ends with a dash and trim it here.

rogden commented 4 years ago

@alesso-x Thanks for reporting! Given the prefix can contain any valid CSS selector character, I ended up concatenating the prefix directly with the Tailwind class name without any additional logic to add/strip/replace characters.