Skip to content
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

How can I add "text-indent" with TailwindCSS #928

Closed
ghost opened this issue May 20, 2019 · 15 comments
Closed

How can I add "text-indent" with TailwindCSS #928

ghost opened this issue May 20, 2019 · 15 comments

Comments

@ghost
Copy link

ghost commented May 20, 2019

Is there any way to add "text-indent" with TailwindCSS ?

@hacknug
Copy link
Contributor

hacknug commented May 20, 2019

You can use one of these two plugins:

@adamwathan
Copy link
Member

Yep those will work, or you can just follow the instructions for adding your own utilities in the documentation:

https://tailwindcss.com/docs/adding-new-utilities

@MarcelloTheArcane
Copy link

@adamwathan Is there any way to add the default numbers?

For example widths have the increments 1, 2, 3, 4, 5, 6, 8, 10, ... 56, 64 which correspond to specific rems.

I'd like to be able to make a utility for .indent-1, .indent-2, etc programmatically.

@adamwathan
Copy link
Member

@MarcelloTheArcane Use this plugin:

https://www.npmjs.com/package/tailwindcss-text-indent

...and configure it like this:

// tailwind.config.js
module.exports = {
  theme: {
    textIndent: theme => theme('spacing'),
    // ...
  },
  // ...
}

@bobgravity1
Copy link

the fact that i need a plugin to indent a paragraph honestly shows how broken web dev is..

@fuchunhui
Copy link

why plugin or utilities instead of default

@dospolov
Copy link

can you add 'indent' as default now with JIT mode?

@proimage
Copy link

proimage commented Jul 23, 2021

the fact that i need a plugin to indent a paragraph honestly shows how broken web dev is..

Not web dev; Tailwind. ¯\_(ツ)_/¯

@JessicaSachs
Copy link

FYI, if it's helpful for someone, this is bundled by default into WindiCSS (A Tailwind-compat library, with native JIT... originally made for Vite). I was honestly surprised when indent-sm autocompleted in my editor 😅

@dospolov
Copy link

dospolov commented Aug 1, 2021

@adamwathan is there a reason why this CSS style is not provided out of the box?
For me it's pretty basic, but maybe there is a technical complexity

@bobgravity1
Copy link

bobgravity1 commented Aug 1, 2021 via email

@JessicaSachs
Copy link

how do you do it without tailwind?

text-indent is just a CSS property. Here’s a CSS Tricks article on it.

@joshxyzhimself
Copy link

@adamwathan, can't this be a built-in feature?

thank you!

@jpoints
Copy link

jpoints commented Sep 27, 2021

I googled this, and ended up here. So I am another one wanting this out of the box.
I assume it comes down to managing the size of the base build.

@hacknug
Copy link
Contributor

hacknug commented Sep 27, 2021

It was added to core in #5449 about three weeks ago so I think it'll be included with v3. Core team can probably clarify if any of you have more questions but I'd say be a little more patient and you'll get this in core soon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants