tachyons icon indicating copy to clipboard operation
tachyons copied to clipboard

How do you style body content?

Open robjwood opened this issue 10 years ago • 4 comments

I'm hoping this question is not as stupid as the title suggests!

I'm using Tachyons for my personal website and it's working great. The only question I have is regarding marking up body text.

I notice on the Tachyons website, for example, that each paragraph has a number of classes. For example:

<p class="f6 f5-ns measure lh-copy mt0">Text here</p>

Makes sense. But assuming you don't add these manually to each paragraph, how do you set up your build system to generate this kind of markup?

robjwood avatar Oct 31 '16 10:10 robjwood

If you don't want to manually add classes to each element you can make a paragraph component (or any component really) with the classes you want and reference the component. Not all setups make building components easy, but if this is a big problem for you I'd look into setups that will allow you leverage the power of components. Alternatively you can take a look at github.com/tachyons-css/tachyons-cms as well.

mrmrs avatar Oct 31 '16 11:10 mrmrs

... I'd look into setups that will allow you leverage the power of components.

I'm guessing React would be one of them. I'm slowly starting to see the benefit of using a framework like this so I think that'll be my favoured route.

I think you also answered this is in issue #267 as well. Thanks for the response.

robjwood avatar Oct 31 '16 21:10 robjwood

@robjwood yo-yo, bell, choo, erb, lodash, .NET, and lots of others should also allow you to build components as well. React is very cool, but definitely not the first framework to enable the ability to build components.

mrmrs avatar Oct 31 '16 21:10 mrmrs

Plenty for me to try! Thanks.

robjwood avatar Nov 01 '16 12:11 robjwood