Upgrade to Pro — share decks privately, control downloads, hide ads and more …

vanilla-extractを使ってみた!with React

vanilla-extractを使ってみた!with React

Azusa Okamoto

April 24, 2022
Tweet

More Decks by Azusa Okamoto

Other Decks in Programming

Transcript

  1. Styling API〜style~ export = ({ : , : }); const

    toDoStyle style display justifyContent 'flex' 'space-between'
  2. Styling API~globalStyle~ globalStyle( , { : , : , :

    , : , : , : }); 'body, #root' '#FFFFFF' '#1A1A1A' '0' 'flex' 'column' '100vh' backgroundColor color margin display flexDirection minHeight
  3. Styling API~createTheme~ export export , = ({ : { :

    } }); = ({ : . . }); const const [themeClass vars] alertBtn vars createTheme style background alert backgroundColor background alert 'red'
  4. Styling API~createTheme~ < = > = > 全て削除する div button

    => button div className onClick className { } { } { } themeClass alertBtn < = </ > </ > () () handleDeleteAll
  5. Styling API~createGlobalTheme~ export = ( , { : { :

    , : }, : { : }, : { : }, : { : , : , : } }); const globalTheme createGlobalTheme ':root' '#1A1A1A' '#7FFF7F' '#FFFFFF' '#7FFF7F' '0.5rem' '1.5rem' '2.5rem' background main success font color color success size xs s m
  6. Styling API~createGlobalTheme~ export = ({ : , : . .

    , : . . }); const footerStyle globalTheme globalTheme style marginTop backgroundColor background main color font color 'auto'
  7. Sprinkles API const = ({ : { : { :

    }, : { : } }, : , : { : [ , ], : [ ], : [ , ], : [ , ], : . , : . } }); responsiveStyle globalTheme globalTheme defineProperties conditions desktop mobile defaultCondition properties display justifyContent textAlign width paddingLeft size paddingRight size '@media' 'screen and (min-width: 1024px)' '@media' 'screen and (max-width: 1023px)' 'desktop' 'flex' 'block' 'center' 'center' 'left' '50%' '100%'
  8. Sprinkles API < > < /> < /> < =

    , > < /> < /> </ > </ > div div div div Form DeleteAllBtn ToDos DoneToDos className display: justifyContent: { 'flex' 'center' } sprinkles( ) { }