-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utility for text-shadow? #162
Comments
I also needed it on a project and added them based on @responsive {
.text-shadow {
text-shadow: 0 2px 4px rgba(0,0,0,0.10);
}
.text-shadow-md {
text-shadow: 0 4px 8px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}
.text-shadow-lg {
text-shadow: 0 15px 30px rgba(0,0,0,0.11), 0 5px 15px rgba(0,0,0,0.08);
}
.text-shadow-none {
text-shadow: none;
}
} |
We're not opposed to adding this at some point, but going to skip it for now since it's so easy to add utilities yourself. We may revisit this sooner once we've made it easy to opt in/out of different modules. |
@adamwathan is this still going to be considered? |
You can use @benface's plugin for this: https://github.com/benface/tailwindcss-typography |
Update padding, margin, and negative margin docs
Just commenting in 2020 that this little utility is still welcome : ) |
Hi @adamwathan. Yes, this is easy to add. But what are the disadvantages of adding a few more utility classes to Tailwind? Why should all Tailwind users, who need this, add it themselves? I guess, the situation has changed in the meantime, and there wouldn't be any disadvantage today to add more utility classes. |
I thought this was the concept of tailwind, can you please explain again why exactly no text shadow is added? @adamwathan thanks!! |
we need text shadow but not with an extra module, which is still working fine. |
Hi, @import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@layer components{
@responsive {
.text-shadow {
text-shadow: 0 2px 4px rgba(0,0,0,0.10);
}
.text-shadow-md {
text-shadow: 0 4px 8px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}
.text-shadow-lg {
text-shadow: 0 15px 30px rgba(0,0,0,0.11), 0 5px 15px rgba(0,0,0,0.08);
}
.text-shadow-none {
text-shadow: none;
}
}
} Could anyone help me? |
I think you are using the wrong syntax for this, I looked at the current tailwind docs and founds this is how you make responsive utility classes. In your index.css try
|
Stupid sarcastic shit like this is not welcome here. |
Yeah I agree. I saw this in my email and thought it was legitimate, not knowing anybody's name in this thread. (In addition to also bring somewhat rude and not contributing to the conversation) |
+1 I just finished designing a new site with Tailwind. I was able to do this with zero custom CSS. Well, almost. I had to add two classes for having a text-shadow. Use case: having text as an overlay on an image (Article Banner). If I go for a white text but the editor happens to upload an article image with a lot of white in it then it gets very hard to read the text. Yes, it is very easy to implement a solution myself, but I still wanted to give my +1 in here. I think having text overlays on images is not an uncommon use case and I think it would be cool to have a solution on this in Tailwind. |
+1 |
I was wondering too why there's no text-shadow directive since tailwind have include some less common directive? Can we reopen this issue please? +1 |
Please can you explain to us the reason why Thanks! |
Hasn't been added because we haven't prioritized working on it. I think it would be a good thing to add but it's a ton of work doing all of the research to figure out what values should be included by default and designing great default text shadows. The box shadows in v1 took two of us working on it for about 100 hours, doing all sorts of experiments with real objects and light sources and studying dozens of existing well designed sites and design systems. So would still like to add it, but it's not an hour long job or anything, at least not to do things to our standards. |
Got it. Me (and probably a few of us here) thought it would be a copy-pasta of Thank you for the great work! |
Oh wow, I didn't realize it was that complex either. Thank you for taking the time to explain this. I think your time is better spent improving Tailwind in other ways 😄 Thanks for all the work you do |
Thanks for the great work! I still would like to see text-shadow on tailwind tho, it's such a common utility that I think even if it took a long time it'd be worth it |
I understand that this isn't a priority, but it is a standard CSS element used frequently for more standardized design techniques. Such as video backgrounds with text overlays to be specific. Would your team be open to outside resources helping get this done? My company has been largely moving as much of our client work over to using TailwindCSS with Laravel integrations because it is really good and our developers appreciate not having to compile assets every few minutes. We're trying to move everything out of bootstrap and SCSS but things like this are making that relatively not possible, at least for the latter. I would like to stick with a library that I can safely assume standard elements would be apart of and it's a big feature that would further solidify our decision to solely use Tailwind for future projects. |
Hey @brteller! You don't need text shadow utilities to be in core to use them in your Tailwind projects, the library is super extensible: https://tailwindcss.com/docs/adding-new-utilities We'll definitely add it to core one day but the biggest hurdle is doing all of the design research necessary to come up with the right set of default values. |
Isn't that the whole point of Tailwind though? I mean, technically, we could add all the utilities ourselves, but that kinda beats the purpose. |
@matronator I don't think the point is to solve every use case for every project automatically out of the box. Are you suggesting we should get rid of the plugin API and make it impossible to add custom CSS? |
@adamwathan That's not what I'm saying at all. I don't disagree that Tailwind solving every possible problem is unfeasible, I just don't agree with your reasoning against implementing this (because it's easy to make it yourself) - you can make that argument for basically every Tailwind class. |
@matronator That's not the reason for not adding them though, the reason for not adding them yet was explained here: "You can add them yourself" is the rebuttal to "I can't use Tailwind because I need text shadows." |
@adamwathan Got you, sorry, missed that comment. |
@adamwathan I understand where you're coming from and do appreciate the fact that you can easily extend or use outside stylesheets for Tailwind. I'm with others on this one though, having basic white and black text drop shadows with a few default sizes would immensely be useful. Obviously you can't account for every situation, color and size, but 90% of the time you don't really need to. Just as with rounded corners, a text-shadow-sm -md -lg and -xl would suffice in black and white. Which would cover the majority of use cases needed out the box. I love Tailwind, I appreciate what you guys have built. This is one of those features that the community and your users want immensely, it's not an obscure request or weird CSS component. It's used commonly enough that it would be nice to rely on the core library out the box. |
Was hoping to see this in v3. |
2022 and still waiting |
4+ year issue, and people are still asking for it, don't you guys think this should be getting some priority or timeframe at least? |
@Demozo See #162 (comment) If you are unhappy with the work being performed for you for free you are welcome to use another framework, I don't have much patience for this sort of attitude. |
@adamwathan I am simply asking whether or not this should be getting more priority since people have actively been asking for this for over 4 years. There isn't any "sort of attitude". I have read that comment, and I'm asking if the situation has changed since then. |
@Demozo Check are you familiar with windicss? Check https://windicss.org/utilities/general/typography.html#text-shadow |
Why not added this? |
As a recap, support for text-shadow will likely not be added to tailwind soon as per this comment but is already achievable in a couple of ways:
If you are reading this thread from the future and you're still wondering if this will be added as a core utility, read the thread because the answer is still probably "not right now". Don't be the timewaster that posts yet another pointless comment asking: "Why not added this?" |
People following this thread may be interested in this tweet: https://twitter.com/steveschoger/status/1515027409418002432 |
I wish it were an actual class (though I understand the hundreds of development argument) but I have spent a couple hours now trying to get the examples in this thread to work without success. Probably will take me a hundred hours to figure it out the way it is. |
man this utility class is needed..... |
Then how about you contribute one to the project, @REGEX777? For anyone else still struggling to understand how to make |
Thanks a ton @lachieh -- Not sure why I can't get the CSS classes example to work in my project, but the inline example you provided is working wonders for me right now. Thanks so much! |
For multiple text shadows you can also use
|
Another reason why this is very much needed: text-borders! like having a 1px (or 2 or whatever) shadow around text that functions as a 1px border. I think this is something that's used very ofter and can be added without a lot of investigation work, because it can use the same rules/guidelines as for normal border. Just using 'text-border' instead of 'border'. I've also filed a seperate issue (#8598), since this might be a bit off-topic. |
@adamwathan I have quite literally watched this thread for years. When I first started using Tailwind NOT having text shadow was a deal breaker. Like; how do you put text on top of a graphic, where some of the graphic - is the same color as the text? So it is unreadable. OUT OF THE BOX - you can not. What makes Tailwind so amazing is that OUT OF THE BOX - it is extremely simple and extremely powerful. Except as a busy Noob, I could not figure out how to put text on top of a graphic and read it all. Yes - I admit, then I could not connect the dots of customization. But as a Noob, I did not want to learn how to customize ANOTHER bloody program, while learning a different one. May I suggest, a step by step, V3.0 Tailwind tutorial of adding text shadows on the official website. When you search for "text shadow" on the official website you should get an excellent example of customization that everyone will want. (kills two birds with one stone) Thanx ============================================================ In your preferred editor search for @tailwind. below utilities add ... @layer utilities {
} YOU MUST !!!! ... mycolor is whatever color name or text you want to use the "px" values are the offset values of where the shadow will be located relative to the text to use |
@gitRup-ca there is a better solution in that case
|
@tordans AWESOME!! Truly looking forward to checking things out in a few weeks. Fair warning though. If a new version of Tailwind breaks a strict Content Security Policy (CSP) ; I will jump faster then a frog on a hot tin roof ! Stupid LiveWire buried an avatar service into Laravel Jetstreams. Might as well put a 1px webhook into everything everyone does. NOTE: This is NOT a discussion about CSP. I will NOT reply. I just wanted to give the Tailwind Team a compliment, and in particular @tordans. |
We want to use this in a project. From the example of @gitRup-ca and @volkandkaya we've created this:
This wil outline the font on all sides. Using box shadow color for the colors: https://tailwindcss.com/docs/box-shadow-color |
@jhhazelaar I created a plugin for this usecase. github issue: #8598 |
@jhhazelaar glad I could help. Would love to see 5ish classes added to Tailwind. |
+1 - came here looking for text shadows! |
@adamwathan is it possible to lock this issue until there is an update? All the spammy +1 comments are irritating. |
+1 - created an account to keep an eye on when you finally add text-shadow to Tailwind. From what I'm hearing, it's coming soon! |
What about usin' |
why you blocked Egypt IPs |
+1 |
Is text shadow here? |
Hey, what about create an utility for
text-shadow
? :)The text was updated successfully, but these errors were encountered: