DaisyUI – Tailwind CSS Components
daisyui.com
daisyui.com
But I actually think I will use this. A big problem with CSS is that you end up making overrides no matter how composable you make the classes. And some simple things (e.g. responsiveness) are unintuitive and / or annoying to do in CSS. Hence Tailwind's "CSS-in-HTML" mini classes. But that doesn't fill the core purpose of CSS, bigger general-purpose classes to avoid repetition. Combine the two (general classes + mini classes for slight case-by-case fixes) and you get the best CSS experience I've seen so far (at least I think, I haven't tried it yet).
10000% agree with this. I have found that copy/paste until you need to go back and change the same value a few times is worth its weight in salt with CSS. Never has "a poor abstraction is worse than duplicate code" been truer than in CSS.
What I found in my FE days ways that it wasn't until the project shipped and we were iterating on v2 did the actual reusable classes appear.
And I find that looking at a single media query over semantic classes to be far easier to understand than utility classes scattered over multiple elements. Looking at tailwind responsive classes hurts my brain.
I also never had to do it when I was using Emotion, and I used that for 2 years.
Tailwind never wanted to remove component libraries, they just wanted a straightforward and easy way to make these components.
Oldschool custom stuff -> BS -> Tailwind -> Tailwind with BS UX
There are still some cases where classes are useful, like JS or when I have very different components with some shared style. But these are mostly edge cases. FreeMarker has some other problems though.
Using a convention for custom classes helps distinguish from tw classes and other libraries, and allows stringent linting of css selectors to make sure the specificity issue is covered (without using !important on all tw and custom utilities which imho is a bad solution).
I mean. This looks alright and it will certainly make any UI look pretty decent, but the execution is not superb like the actual TailwindUI library which is incredibly well thought from a visual design perspective. Those components are perhaps less shiny than these but they are incredibly functional and way more intentional.
This is a good effort though and I hope to see it improving.
If you are able to observe what is severely lacking in this implementation, I am pretty sure that the Github author would welcome your suggestions / comments / PRs and any contribution to make this better.
For a start, this is actually good (enough).
In the same vein that TailwindUI is still continuing to evolve as the maintainers are finding optimization to make it better.
I'm not saying that's necessarily the case here, but there is a strong argument in favor of not making the default theme for a UI library look perfect.
Sounds like native GUI experience on Mac or Windows for quite some time, then? I'm certainly not offended when all buttons look the same. At least I immediately know that they're buttons.
Not to make a value judgement on ebooks, but I just really like physical books sometimes - if it was on Amazon I likely would have bought it.
Again, not a value judgement on the content - I'm sure it's great (I'm a paid and happy user of TailwindUI)
A lot of the products I see turning up on Show HN would look infinitely better if they used this library. (The ones where UI design is clearly not the solo-developer's strength).
My understanding of the functional CSS approach was that you'd make a button component, and use the variety of "atomic" classes to style it. If you're using a "btn" class etc, it muddles the distinction of where the semantics live, and things get harder to reason about / debug.
Tailwind is great but sometimes you end up having 10-15+ classes for basic components that makes the code harder to read and reason with.
We should have utility classes and composability, but relying on them exclusively is also not necessarily the best way either.
That's my understanding at least, like if you want to make a button, instead of have the same 10+ classes posted everywhere you make a new class with @apply and keep the styles uniform.
Then in the future if you need to change one of the core utilities it's also easily updated to all you the @apply classes you make.
Am I misunderstanding the purpose? I've only used tailwind twice.
However you have to use them yourself. With vanilla Tailwind there is no out of the box @apply directives already set you can use. Think of DaisyUI as basically a whole set of @applies someone already made for you.
For users new to frameworks with utility focus it can be less steep learning curve to experiment and all the out of the box abstractions can reduce the need for having your own.
For a work project, I'd use just tailwind for the reasons you mention.
I paid for the TailwindUI pack too. But as nice as Tailwind is, the guys who built TailwindUI don't really get or understand a lot of real-world design patterns.
A lot of stuff in there is needlessly complicated. Our team end up trimming down things to 50% of the markup that they use, while retaining full responsiveness.
Overuse of flex for simple paradigms is a constant complaint of mine.
Hope DaisyUI improves Tailwind in some way.
Anyway... sorry to get sidetracked on a sidebar.. lol.
I did a review of Tailkit in general here: https://nickjanetakis.com/blog/reviewing-tailkit-300-tailwin...
TUI design + DaisyUI's abstractions is the dream.
It's all relative. It's clear they understand more than I do, and I'm not a terrible UI designer, so paying for TailwindUI has been a no-brainer in terms of the value delivered to my projects so far.
I have to agree with this.
I would recommend to use a prefix on your custom classes, to "namespace" them. "btn" is far too generic. This can even be linted by eg. postcss-bem-linter.
Each Tailwind class corresponds to a CSS property, with a few exceptions where you have utility classes for degrees of that property (for example, padding, margin). Then along come these CSS component libraries, which substitute a thicket of these utility classes for a single class. Including Tailwind UI itself.
Given that the relationship of class to property is one to one, why not cut out the middle person and just use CSS directly? There seems no real advantage. You've basically indepedently re-invented CSS, while adding a strange layer of additional abstraction on top. It is nice and fast to write it in the HTML I'll grant, but, the speed advantage is not so great that it is worth it compared to the mental overhead of other aspects of working with Tailwind (e.g. having to trim all the classes with automated scripts and so on).
Perhaps I am missing something here?
Consider a site that mostly renders Markdown or XML documents. Tailwind is probably the wrong choice. You have less control of the HTML content in this case, because it's generated. If you want to use Tailwind here, you'd need to make liberal use of Tailwind's @apply directive for basic declarations, which IMO is not the best expression of Tailwind usage. On the other hand, you have a lot of control over the CSS. It makes more sense to write the CSS directly.
Now consider an organization with many separate web properties, which all require consistent branding. The organization has a UI guy who creates universal stylesheets and components for use across sites. Here you have less control over the CSS, and more over the HTML. Tailwind makes more sense. You can add all the utility classes to HTML that you want, with few overrides or other enterprise pull-ups.
This latter scenario also highlights one of Tailwind's strengths. Tailwind limits your options. If you need to keep a brand consistent across a large number of properties, Tailwind keeps you in the guardrails of the style guide. I can't be the only one who's worked at an organization where there's supposed to be only one shade of blue to represent the brand, but you wind up finding 160 different shades of blue throughout the CSS.
Anyway, Tailwind has its time and place. I love it when it fits.
A very good example on OP's website for a button:
Using tailwind:
<a class="inline-block px-4 py-3 text-sm font-semibold text-center text-white uppercase transition duration-200 ease-in-out bg-indigo-500 rounded-md cursor-pointer hover:bg-indigo-600">Button</a>
Using daisy: <a class="btn btn-primary">Button</a>
Although I personally think that the corners at a bit too rounded by default, giving it a very amateur look but I think you can customize that.But a very promising project indeed.
If you want to do in "raw" tailwind (i.e. without this component library), you can use layers to create your own component classes, e.g.:
@layer components {
.btn {
@apply inline-block px-4 py-3 text-sm font-semibold text-center uppercase transition duration-200 ease-in-out rounded-md cursor-pointer;
}
.btn-primary {
@apply text-white bg-indigo-500 hover:bg-indigo-600;
}
}You can, but then it rarely happens that you want the CSS to be fixed in that way for all time: the brilliance of tailwind is that you get resposniveness just by adding a few more classes. You cannot do that with inline CSS.
Makes me think- all I would really want is to be able to have multiple values in css. Maybe something like .
.card { width: 5rem md: 10rem; }
Snap… am I on to something?
I suppose a library of common elements is a good thing to have, but the reason I like Tailwind is that I can use the utilities at first and then easily gather them together as plain CSS classes as and when that makes sense to me.
2) It has variants for hover, etc (e.g.: class="bg-black hover:bg-white"). AFAIK you can't do that with inline styles.
3) I find it plays nicely with a workflow where I start out not knowing exactly what I'm doing, which is almost all of the time. I can smash ahead and do things in the class="" of each tag, then as I notice that I'm repeating myself, I grab small chunks of the class list and put them in '@apply's in a CSS file. Bottom-up, liek.
The class lists are just a lot more manageable than inline styles. They're copy-pastable and really easy to read when you get used to it, as long as the lists aren't too long.
https://frontstuff.io/no-utility-classes-arent-the-same-as-i...
But in terms of structuring your code, there are related concepts in other areas of programming:
The most general concept applied here is stratification or layering. You want to decompose your code into more general pieces so you can use those pieces to compose the actual solutions.
Example: Say you wanted to write a compiler. It typically much easier to simplify, AKA decompose the compiler into a scanner, parser, analyzer, optimizer, emitter etc. The users of your compiler probably don't care that you decomposed and layered your code. But you do care, since you can reason about your code in terms of small/local problems. Maybe you don't stop there. Your scanner can be stratified further, so you can easily build evolve and reason about it.
This is the primary thing these types of libraries do. They give you generalized building blocks that have compositional semantics that make sense. You can use their sane defaults or generate them from scratch using a design system.
Secondly the atoms are discretely defined. You're not dealing with all possible values for each property but with sets that you can join/compose. The generated classes have this little mini-syntax that you first need to get used to a bit, but after a while you'll easily remember the prefix schema of your classes (Tailwind's documentation site is also very well made). Tailwind cross joins the atoms for you, but then also deletes all the classes you didn't use in your project.
What's the point in spending 20 hours learning some custom interface that's only used in like 5% of projects and will probably be gone in 5 years, when you could spend 30 hours learning the standard that's been around for decades and understand every library for years to come?
Just learn CSS, it's not that hard.
I never sat down for hours to learn it. I just started using it. Most of the classes were very intuitive with a working knowledge of the box model. For anything else I just searched the docs or even better, got the VSCode plugin to suggest the correct one
It's not a custom interface. It's just classes. It's got a type of syntax, sure, especially for media queries but it's not much different than "learning" the classes from bootstrap
It's literally just CSS but abstracted as convenient classes as the name "utility classes" implies already. I don't understand why people keep telling others to learn CSS instead. I also hate dealing and writing CSS cause it's cumbersome and unwieldy and this is a much better way of styling my HTML and getting immediate feedback
That way you get the full tailwind experience without the tedious rewriting of components.
It looks like Tailwind and Tachyons are useful tools but they do have a sweet spot, and I've run into the annoyance of 20+ classes in my tiny projects as well. Descriptive
Real changes to the landscape have been made along the way:
- Flexbox and to a lesser extent grid are grokked by many
- People are much more willing and able to use CSS variables
- Shadow DOM encapsulation and other methods of isolating styles from one component to another are well explored
- there's some stuff on the horizon where people are JITing here and there and writing custom compositors ("Houdini" and related tech)
But I'm not sure there have been any large paradigm shifts in CSS over the last 10 years, and Tailwind no matter how successful it's been commercially and in the headspace of developers seems to have been largely a very useful somewhat passing obsession.
What lead me to make the comment was the discussion point that "btn btn-primary" was so much more useful than 20+ tailwind classes. I agreed (it's something I have come across as well), but
It's clear that Daisy UI will get you up and running quickly and there are lots of similar projects out there that do things like this, but the meta discussion around whether we're going in circles or if we've actually moved forward and found a nice mix between what was the bootstrap style (1-2 classes that do all the work) and tailwind/tachyons (5-10+ classes that do the work).
To make the discussion less meta -- is the future things like DaisyUI? Bootstrap like classes but with the outlet for overriding not being manual CSS but actually being tailwind-style classes? In the past it was Bootstrap + your special large class/baked in styles, but in the future maybe it's "btn btn-primary box-shadow" or whatever, clearly a middle point of sorts
The impression I got is that Tailwind is essentially CSS 2.0 with warts ironed out (sorry for the unpleasant mixed metaphor):
A) CSS / Tailwind: lots of little 'atomic' classes describing individual visual properties. Easy to understand, easy to customize, but slow to read, slow to get started, with plenty of stuff to learn
B) CSS frameworks / Tailwind components: fewer classes declaratively describing the component's role (eg 'btn-primary'). Quick to get started, elegant to read, but prone to abstraction leakage and trickier to bend to your own exact specifications
There's always been a need for both kind of tools for different projects, in the same way that e.g. network programming may involve anything from bit-banging commands to high-level protocols.
Over the years CSS frameworks kept improving, but CSS was much slower to do so - although it acquired flexbox, grid, etc., the language limitations stayed, and they were bad enough to spawn SASS/LESS out of a genuine need.
Tailwind saw a ton of hype and adoption because all the developers who had always wanted to go the (A) road now had a well-designed set of simple classes they could use with a lot fewer footguns, plus a bunch of developers who had adopted (B) because it was the road that had all the momentum suddenly realized that they probably wanted to use (A) once it was made less painful.
DaisyUI and similar projects don't do anything that Bootstrap didn't do for CSS, but by building on top of Tailwind it means that, when your project or resources grow and you want to move from (B) to fully customizing your style in (A), you will be able to write your individual little graphic touches in Tailwind instead of plain CSS.
I actually like it, as looking at the code I can see exactly what it does. 'btn-primary' doesn't convey anything to me. 'rounded text-sm font-bold py-2 px-3 bg-indigo-300' I know exactly what that is going to look like.
I also appreciate the removal of classes not needed if using a build step - much nicer to have a small css file that has exactly what you use, rather than a bootstrap style kitchen sink
I'm not sure about this path, but it might be good for a beginner.
Both libraries have pros and cons.
Because there's an expected built-in behaviour to these elements.
> It is accessible, semantically correct, and follows accepted design conventions.
There's nothing accepted about disguising a link as a button. Especially when it literally does no action except, you know, linking to a different page.
Though, of course, there are ambiguous situations, especially in the context of PWAs. But code examples are not an ambiguous situation.
<a class="btn btn-primary" href="/new">
New
</a>
Below the heading there is a list of repos which had a recent activity by you. Each list item has a link to an that repo. <a class="dashbord-underlined-link" href="/namespace/repo">
namespace/repo
</a>
There is a substantial difference between these two links. One takes you to a location, the other one starts a process which ends with an action.As a user you are not going to be clicking the “New” button everyday. Maybe once a month, maybe once a year. So you are likely not going to remember where it is from the last time you clicked it. If you don’t find it when you need it, you will get frustrated. It needs a lot of visual weight relative to the other links in this nav section. Giving the same weight as a button is a reasonable decision.
edit: I said “form”, but I meant page. Forms actually use buttons!
- https://github.com/thedevdojo/tails
- http://tailwindcomponents.com/
- https://tailwindui.com/components
- https://mertjf.github.io/tailblocks/
- https://shuffle.dev/ Tailwind visual builder
(from my resources list https://github.com/sw-yx/spark-joy/)
My only gripe with this is that you should then use a clearly defined and separate naming convention for custom classes, for example SuitCSS is good:
Not
btn btn-large rounded-full
But
du-Btn du-Btn—-primary rounded-full
ie. PascalCase component names,
optional prefix (eg. du for daisy ui, because other apps also have their prefix see eg. Twitch and Algolia css)
Bem conventions like double dash for modifier as opposed to a descendant
https://github.com/suitcss/suit/blob/master/doc/naming-conve...
So yeah I would like to be able at a glance to know where a class is from. "btn" is not from tailwind, but where is it from? What if my app uses multiple components, from third party etc? It’s not clear.
Other than that This is better than Bootstrap approach even with custom classes, because you take care of css specificity problem (assuming you can add a tw class anywhere and override the builtin custom classes)...
this is the middle way that nobody uses for whatever reason, the one that makes sense, but requires a good basic understanding of css specificity as well as setup stringent css linter
Also using a convention would let you use a good linter on the custom selectors
Is the code on the left (with lots of classes) actually what tailwind is like to use in practice?
As a fan of tailwind, I can say that I initially thought this was dumb and it would be hard to read through a huge number of classes applied to each HTML element. Later, I found that for many of my reusable components, I could combine classes into a single class. As an example, my stylesheet may look like this:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.button {
@apply text-2xl p-2 bg-gray-100 text-gray-600 border border-gray-200 cursor-pointer hover:bg-gray-200 hover:border-gray-300;
}
}
I can now just give all of my reusable buttons the ".button" class instead of the giant string above. .button {
background-color: $gray-100;
border: 1px $gray-200
/\* so on... \*/
}
i don't understand how these "micro" css classes actually help versus just setting the property. @tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.button {
@apply text-2xl p-2 bg-gray-100 text-gray-600 border border-gray-200 cursor-pointer hover:bg-gray-200 hover:border-gray-300;
}
}
in to this: .button {
font-size: var(--text-2xl);
padding: var(--p-2);
background-color: var(--gray-100);
color: var(--gray-600);
border: solid 1px var(--gray-200);
pointer: cursor;
}
.button:hover {
background-color: var(--gray-200);
border-color: var(--gray-300);
}
Adjust variable names to taste. No build step, no extra tooling, just as readable in my opinion. On top of that, using CSS variables means that those values can be changed at runtime. You basically get user-driven theming for free.I'm building an app like this right now and it's been lovely.
button: {
[MediaQueries.Medium]: ...
}
I can't use CSS variables for that but I personally don't think it's useful to let the user redefine those queries anywayIt's not so much about what you do as a single designer on the initial design, more about what a team of designers do when adding new apos/modules to an existing product.
In theory you could use bootstrap and a theme - but your fellow team members will get lost, re-invent some styles etc.
I'm inclined to solve this problem with discipline and corporal punishment - but I'm afraid the tailwind-people are on to something.
Basically the cascading part of css does not work well for applications / a suite of applications - it works better for actual hypertext documents (like sgml might) - where you can make a layout that works, while the browser handles the user experience (UX). When layout/design becomes "just" part of how an app looks, but the important is how it beheaves (including things like hover, expanding menus etc) - bare CSS doesn't work as well. Not technically, but from a perspective of an evolving code base.
Nope, I reject this. We should be so much farther ahead than this. It’s the garbage fullstack developers that need this crap to make a good ui. They don’t belong on the frontend, and I’m pretty tired of it.
Our UI/UX will get shittier and shittier if we coddle this group.
I agree with some comments that it is lacking that wow factor that TailwindUI has.
I'm working on https://versoly.com/ which is a Tailwind Website builder and have ran into a bunch of issues with Tailwind when it comes to building static sites.
I love that Bootstrap offer "btn btn-primary" and it makes it very easy to keep a consistent site.
For Tailwind to take off it needs
- A list of components (maybe 20 ish, buttons, tabs, navbars being the main ones) - JS for components - Container system (I have built one that works similar to Bootstrap and makes it much easier to create responsive layouts quickly)
Once those core parts have been built I believe developers will create more advanced libraries such as lightboxes etc which will save even more time.
I'm a big fan of the new https://github.com/vuejs/petite-vue which is only 5kb and comes with a lot of power. Also combining it with something like https://github.com/CaptainCodeman/x-transition would be interesting.
I really want to see Tailwind grow so if you're interested in opensource or want to create paid UI kits feel free dm as I have a ton of ideas.
You have a lot higher standards than I about what "taking off" means :-D
But I talk with a lot of full stack and backend developers who still use Bootstrap. They even own TailwindUI and other templates but stick to Bootstrap.
That to me means there is a big issue with Tailwind and the developer experience.
Once solved Tailwind will grow even faster and help more developers/companies.
At Shuffle[1], we create templates for Tailwind, Bootstrap, Bulma, and Material-UI and need to convert UI libraries from one technology to another.
We decided to write converters that can transform HTML classes & Tailwind config to Sass config.
Probably, we will release it as open-source soon.
// Example:
// Tailwind.config to Sass
// button.js
const { theme } = require('../theme.config.js');
module.exports = {
bootstrap: {
'input-btn-font-size': theme.fontSize.sm[0],
'input-btn-padding-y': theme.spacing[4],
'input-btn-padding-x': theme.spacing[6],
},
bulma: {
'size-normal': theme.fontSize.sm[0],
'button-padding-vertical': theme.spacing[4],
'button-padding-horizontal': theme.spacing[6],
},
};
// HTML
export const mappings = [
{
from: ['flex', 'flex-wrap', '-mx-4'],
to: ['row']
},
}
[1] https://shuffle.dev <div tabindex="0"><input ...></div>
Because of that, it is sometimes necessary to tab twice to focus the next element. Not sure whether that is a problem of DaisyUI in general or just their website. But it is definitely annoying.There are toolkits like https://frontendor.com but they all follow the 5-10 year old "theme" of insanely packed content you had seen on SaaS pages some years ago. Together with many photographs or flat humans... I can't find anything with "new" approach which uses more padding, much more detail to typography, bigger fonts etc. shown very good on the https://tailwindcss.com landing page. Or any hint where all the new startups get their designers for these new fresh layouts?
The landing page is like a few divs with some position centres. What would you even use a "component library" for in this case? The only thing on the entire page with any complexity whatsoever are the component demos (which are obviously part of this DaisyUI thing itself) and the code blocks/syntax highlighting, which I'm sure there's a billion libraries for already.
I'm really struggling to come up with any sort of other dependency that would help me build that page any faster than just opening the text editor and shitting out some HTML and CSS.
Do people just spend so much time working with Bootstrap and whatever other cruft that they just never bother to learn the basics?
At this level of simplicity and for churning out marketing pages where you don't care about maintainability, you're probably better off looking for a WYSIWYG editor rather than a library.
Or you could buy the Tailwind UI[2] - they add lots fairly often.
[1] https://github.com/aniftyco/awesome-tailwindcss [2] https://www.tailwindui.com
But alas, the battle for semantic css has already been lost and the community keep going in the opposite way (first bootstrap, which was halfway through, now tailwind which is basically inline styles with variables).
Conversely, Chakra UI Box, which does more or less the same thing is super easy to get into.
This looks nice, but I kind of feel like we’ve come full circle two full times to get to this point.
For autocomplete, have you seen https://tailwindcss.com/docs/editor-support ?
I use it in PHPStorm and VSCode and I get class name autocompletion just fine.
As a JIT mode user, the 1-1 naming would really be useful now.
DaisyUI is beautifully written. This can be the kit with a boatload of work done for you. Think like Bootstrap but better with Tailwind. You can use this to teach how to write well thought-out CSS codes, separation, and extensibility.
TailwindUI is more like Bourbon[1] (was my go-to Sass tool) but on the structural interfaces done for you. I'm standardizing out Web, WebApps, and marketing materials to start with TailwindUI. Someone with good chop of CSS/Tailwind won't likely need to use TailwinUI but it can be a fast tool for teams. It is highly extensible but also has the double-edge sword criteria that a rookie can just keep copy-pasting, repeating codes and still work (not a good thing).
Will we use DaisyUI for the team? Unlikely!
Will I use it for some quick but still larger project, marketing page? I might very likely.
Tailwind UI is great! ( please note that I a primarily a backend dev with limited knowledge of CSS )
Looking forward to explore DaisyUI soon !
Real nice, looks professional and casual - well done!
Aside from that, it looks like a really convenient way to put together a web UI when you don't really want to focus on the UI part of your app too much.
Not too expensive either, I think it was $175 or so.
In the end the point of all of us using tailwind is because its not "opinionated" like bootstrap right?
(NOTE: I did not WickedBlocks/WickedTemplates -- it's the awesome work of the folks over at WickedTemplates https://wickedtemplates.com, which they shared on HN I believe a while back)
I'm actually working on a little side project right now where I turn wickedblocks into a set of usable native web components (as in drop an <import> tag and the component on your page and you're off to the races), because I think that's a much more composable way to use these snippets copy & pasting HTML, looks like Daisy needs to be next.
[EDIT] A bit annoying to others probably to drop a lede and I have no idea when I'll get done and publish it with the blog post so if someone just wants to see the code:
https://gitlab.com/mrman/landing-gear
If anyone wants to contribute a snazzy icon I'd love to take it! There's no landing page to showcase it yet but there's files like lg-left-header/index.html[0] which showcase usage and the intended simplicity.
Obviously if you're trying to get started, use the blocks as they're presented and the awesome work done by WickedTemplates (they've also got some ready-to-go straight out of the box templates and other stuff for you to use on their main site!), but if you're interested in lit[1]-powered drop-in components, follow that space.
[EDIT2] - For those taking a look at the code, note that there are like... 4 variants of the left-header component. Half of the time spent getting this out (it's all simple in theory -- just copy + paste and swap out static text for variables) was figuring out which parts to unify and which parts to keep separate for easy drop-in use. There's not much there yet, but it's more a matter of me finding time to sit down and make these decisions for every kind of component on the wickedblocks page.
There are some concerns like i18n that I've punted on by just making sure that all static text were component inputs, but ideally integration with browser-supported i18n[2] is the proper way to do things in a minimal but standards compliant way.
[EDIT3] - Added note to make it clear I didn't create WickedBlocks/WickedTemplates
[0]: https://gitlab.com/mrman/landing-gear/-/blob/main/lg-left-he...
[1]: https://lit.dev/
[2]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...
No you don't need to write CSS files for that. Bootstrap also offers utility classes.
If I want to customize padding I can add "p-3" or "p-4" class for example.
Same for other properties including colors like "bd-blue-800".
Using bootstrap themes are what I do now but they always have a limited number of components and don't have ready to go, copy-pastable documentation.
Ideally I'd have a library that I can just copy paste beautiful pre-made components.
> Clean HTML
The rest of your code will still use bunch of shitty tailwind shortcuts that are really chaotic the moment you build something more than a simplest component.
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.button {
@apply text-2xl p-2 bg-gray-100 text-gray-600 border border-gray-200 cursor-pointer hover:bg-gray-200 hover:border-gray-300;
}
}
I can now just give all of my reusable buttons the ".button" class instead of the giant string above. I can even add more styles or overwrite existing styles to give it a different look such as: <button class="button bg-red-100 text-red-600">Click Me</button>I recently found a problem with DaisyUI, put up an issue, and it was promptly and politely fixed.
I wish the author would also put up a purchase page on https://themeforest.net/ . I dont mind optionally paying for it - especially a nicely packaged starter for nextjs, etc