Giter VIP home page Giter VIP logo

tachyons-components's Introduction

tachyons-components

Build Status Coverage Experimental

React UI components powered by Tachyons with a styled-components like API.

npm install tachyons-components
import styled from 'tachyons-components'

const Button = styled('button')`
  f6 f5-ns fw6 dib ba
  b--black-20 bg-blue white
  ph3 ph4-ns pv2 pv3-ns br2
  grow no-underline
`
<Button mr2>
  Hello
</Button>

Functional styles

const Heading = styled('h2')`
  m0
  ${props => props.big ? 'f1' : 'f2'}
`

MIT License

tachyons-components's People

Contributors

jxnblk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tachyons-components's Issues

Usage with styled-components

Thanks for building this awesome library!
The API is really simple and awesome.

Sometimes, tachyons are too limited. Do you see a way to integrate this with styled-components?
Maybe something like

import styledComponent from 'styled-components'
import {tachyonify} from 'tachyons-components'

const styled = tachyonify(styledComponent)

const Box = styled.div`
  br-2 bg-blue white
  margin-left: 27px;
`

This wrapping could be something tachyons-components could do under the hood.

Classe Style not insert on the compilation

I try to use the styled method for my body element for a nextjs application:

render() {
const Body = ({ className, children }) => (

{children}

);
const StyledBody = styled(Body)w-100 sans-serif bg-white`;

return (
  <html>
    <Head>
      <script type="text/javascript" src="something"></script>
    </Head>
    <StyledBody>
      <Main />
      <NextScript />
    </StyledBody>
  </html>
)

}
}
`

So classes are correctly insert but the css is missing. Strange thing, this work fine for my buttons.

Can you help me?

Classes with nested children don't work

From reading tachyons.json these probably don't work, because the keys contain whitespace:

"nested-copy-line-height p": ".nested-copy-line-height p{line-height:1.5}",
"nested-headline-line-height h1": ".nested-headline-line-height h1{line-height:1.25}",
"nested-list-reset ul": ".nested-list-reset ul{padding-left:0;margin-left:0;list-style-type:none}",
"nested-copy-indent p+p": ".nested-copy-indent p+p{-webkit-text-indent:1em;text-indent:1em;margin-top:0;margin-bottom:0}",
"nested-copy-seperator p+p": ".nested-copy-seperator p+p{margin-top:1.5em}",
"nested-img img": ".nested-img img{width:100%;max-width:100%;display:block}",
"nested-links a": ".nested-links a{color:#357edd;-webkit-transition:color .15s ease-in;transition:color .15s ease-in}",
"nested-links a:hover": ".nested-links a:hover{color:#96ccff;-webkit-transition:color .15s ease-in;transition:color .15s ease-in}",
"nested-links a:focus": ".nested-links a:focus{color:#96ccff;-webkit-transition:color .15s ease-in;transition:color .15s ease-in}",
"debug *": ".debug *{outline:1px solid gold}",
"debug-white *": ".debug-white *{outline:1px solid white}",
"debug-black *": ".debug-black *{outline:1px solid black}",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.