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

Patterns and anti-patterns in layout

Patterns and anti-patterns in layout

Michael Meleshkin, Frontend developer at Default Value

GDG Cherkasy

May 29, 2017
Tweet

More Decks by GDG Cherkasy

Other Decks in Programming

Transcript

  1. About me › Name: Michael Meleshkin › Company: Default Value

    › Position: Frontend developer › Age: 29 › E-mail: [email protected]
  2. Content 1. Architecture for your layouts, BEM 2. Recommendations. CSS

    3. Something you should know. HTML 4. Other techniques
  3. BEM (Block, Element, Modifier) is a component-based approach to web

    development. Divide the user interface into independent blocks.
  4. Mix › Combine the behavior and styles of multiple entities

    without duplicating code. › Apply the same formatting to different HTML elements.
  5. Dividing the code into parts › Single responsibility principle ›

    Open/closed principle › DRY principle › Composition instead of inheritance
  6. Advices › Don’t use hacks if it’s possible › Make

    your layout intuitive › Try to experiment with techniques
  7. Don’t use hacks if it’s possible Aenean rutrum sollicitudin erat

    non viverra. Vestibulum eleifend consectetur sapien, a feugiat orci molestie at. Sed sodales sodales nulla, quis condimentum lectus tempus a. Morbi cursus elit eget purus consectetur, eu volutpat purus facilisis. Curabitur pretium pretium diam non imperdiet. Cras efficitur eros sed nisl pulvinar ornare. Nullam sagittis ante et mollis convallis. Etiam tempus felis Aenean rutrum sollicitudin erat non viverra. Vestibulum eleifend consectetur sapien, a feugiat orci molestie at. Sed sodales sodales nulla, quis condimentum lectus tempus a. Morbi cursus elit eget purus consectetur, eu volutpat purus facilisis. Curabitur pretium pretium diam In ut fermentum orci, nec placerat orci. Nulla non hendrerit risus. Cras feugiat lorem id massa efficitur hendrerit. Vestibulum dictum leo tortor, non tempor nibh dapibus et. Phasellus non nibh congue, tincidunt lectus in, auctor velit. Etiam sollicitudin nisi metus, quis tincidunt orci sollicitudin nec. Duis enim ipsum, cursus sed diam id, imperdiet aliquet ante. Quisque at ante enim. Nunc semp Rutrum sollicitudin erat non viverra. Vestibulum eleifend consectetur sapien, a feugiat orci molestie at. Sed sodales sodales nulla, quis condimentum lectus tempus a. Morbi cursus elit eget purus consectetur, eu volutpat purus
  8. WAI-ARIA Web Accessibility Initiative — Accessible Rich Internet Applications It

    is a technical specification published by the World Wide Web Consortium (W3C) that specifies how to increase the accessibility of web pages, in particular, dynamic content, and user interface components developed with Ajax, HTML, JavaScript, and related technologies
  9. Example 2: Introduction Enter your name: input label Enter your

    name: area-label=”Enter your name” span
  10. Abstract Roles › command › composite › input › landmark

    › range › roletype › section › sectionhead › select › structure › widget › window
  11. CSS: › Flex › Grid › @supports › Variables Web

    components: › Templates › Shadow DOM › Custom Elements › Imports What are we waiting for?
  12. › BEM - https://en.bem.info/ › WAI - https://www.w3.org/WAI/ › WAI-ARIA

    1.1 - https://www.w3.org/TR/wai-aria-1.1/ › OOCSS - https://www.smashingmagazine.com/2011/12/an-introduction-to-object-oriented-css-oocss/ › Atomic CSS - https://acss.io/ › SMACSS - https://smacss.com/ › MCSS - https://operatino.github.io/MCSS/en/ › AMCSS - https://amcss.github.io/ Links
  13. FUN › Flat hierarchy of selectors (.selectors) › Utility styles

    (.b-white) › Name-spaced name-components