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

CSS Globals

CSS Globals

CSS improved a lot in the last years but for many, it's still one of the hardest parts to handle while developing big web applications. Pre-processed languages like Sass and Less added many new features, but we still have to rely on methodologies such as BEM and OOCSS to avoid name collisions. Component-based libraries like React and Polymer are giving us a new tool to manage large front-end applications. In this talk, Giorgio will explain how to use these approaches so you can benefit from them in your next project.

Giorgio Polvara

October 18, 2016
Tweet

More Decks by Giorgio Polvara

Other Decks in Technology

Transcript

  1. .btn { background: hsla(0, 0%, 100%, 0); color: #fff; outline:

    20px solid #fff; transition: all 125ms; } .btn:hover { background: #fff; color: #6b2afe; transform: scale(1.5); outline: 0; }
  2. APPROVED .label { margin: 1em; padding: 0.3em 0.6em; font-family: 'Black

    Ops One'; font-size: 2rem; text-transform: uppercase; color: #777; border: 5px solid #777; transform: rotate(12deg); }
  3. .label { margin: 1em; padding: 0.3em 0.6em; font-family: 'Black Ops

    One'; font-size: 2rem; text-transform: uppercase; color: #777; border: 5px solid #777; transform: rotate(12deg); } .label { font-style: italic; color #333; }
  4. .label { margin: 1em; padding: 0.3em 0.6em; font-family: 'Black Ops

    One'; font-size: 2rem; text-transform: uppercase; color: #777; border: 5px solid #777; transform: rotate(12deg); } .label { font-style: italic; color #333; }
  5. .label { margin: 1em; padding: 0.3em 0.6em; font-family: 'Black Ops

    One'; font-size: 2rem; text-transform: uppercase; color: #777; border: 5px solid #777; transform: rotate(12deg); } .label { font-style: italic; color #333; }
  6. const Hello = () => <h1>Hello world!</h1>; <header> <Hello />

    </header> <header> <h1>Hello world!</h1> </header>
  7. <Label> Approved </Label> const Label = (props) => ( <div

    className="label"> {props.children} </div> )
  8. <Label> Approved </Label> const Label = (props) => ( <div

    className="label"> {props.children} </div> ) <div class="label"> Approved </div>
  9. .label { color: #777; font-size: 2rem; ... } const Label

    = (props) => ( <div className=""> {props.children} </div> )
  10. .label { color: #777; font-size: 2rem; ... } // Label.css

    const Label = (props) => ( <div className=""> {props.children} </div> )
  11. .label { color: #777; font-size: 2rem; ... } // Label.css

    const Label = (props) => ( <div className=""> {props.children} </div> ) import cx from './Label.css'
  12. .label { color: #777; font-size: 2rem; ... } // Label.css

    const Label = (props) => ( <div className={cx.label}> {props.children} </div> ) import cx from './Label.css'
  13. .label { color: #777; font-size: 2rem; ... } .xyz123 {

    color: #777; font-size: 2rem; ... }
  14. .label { color: #777; font-size: 2rem; ... } .xyz123 {

    color: #777; font-size: 2rem; ... } <div className={cx.label} > </div>
  15. .label { color: #777; font-size: 2rem; ... } .xyz123 {

    color: #777; font-size: 2rem; ... } <div className={cx.label} > </div> <div class="xyz123"> </div>
  16. .label { color: #777; font-size: 2rem; ... } .label {

    color:rgb(1,2,3); } .label { position: sticky; }
  17. .label { color: #777; font-size: 2rem; ... } .xyz123 {

    color: #777; font-size: 2rem; ... } .abc987 { color:rgb(1,2,3); } .bada55 { position: sticky; } .label { color:rgb(1,2,3); } .label { position: sticky; }