How to setup a custom theme #16087
-
Hello,I am new to wanting to support beings other than myself, so I could really use your help creating my own tailwindcss theme that I can reuse across some other project, and just tweak minor things. If this is a waste of my time, please let me know haha.just walk me through it like i am in 6th grade and barely passed my intro to web dev class, only because the teacher knew how hard I triedSo I am learning how to code so I can get a job. I want to freelance, and need to develop a strong understanding of how CSS, and i am doing so becoming a tailwind master. As i release my own tailwinds, I had the idea of asking for help, alas, here I am.The docs are really helpful, but i just need help connecting the dots, as I never used tailwindcss 3.x, only the newest version. All the LLMs I am using are struggling at letting go of their knowledge of the old tailwind. I want to set up my own theme for a linktree-esque page as a starter project, I have a few questions. What is the difference between the following?
I want to do all my customization of my own utility class, I am curious why I cant use I am learning a lot as a beginner so thanks for taking the time to help me! Also I dont ask a lot questions, so please let me know how to format it better.
Here is where I am actually using
I am curious what is the best practice for implementing what I am trying to achieve (my own utility class for various kinds of buttons i may want to use on my page) I feel like using Also I understand I am using the Any and all help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Beta Was this translation helpful? Give feedback.
-
@layer components {
.btn-link { Creates a CSS rulehttps://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_rulesets <button class="btn-link"> @utility btn-* {
.btn-link { Doesn't do anything. The As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding |
Beta Was this translation helpful? Give feedback.
Creates a CSS rulehttps://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_rulesets
.btn-link
in thecomponents
CSS cascade layer. You can use it in your HTML like:Doesn't do anything. The
-*
suffix at the end is for functional utility syntax but no indication of values, types or bare value types are indicated in this directive body. This means there is no way to write a class name that would generate CSS using this directive as-is.As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding
@apply
: