Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 991 Bytes

css3.md

File metadata and controls

58 lines (45 loc) · 991 Bytes

CSS3 (v0.1.0)

  • OOCSS is the preferred methodology (Object-Oriented CSS)
  • Classes should be in recursive alphabetical order
  • Childs of a class should come after the parent class itself
  • Only the direct parent class should be written in selector:
.class {
  /* Some styles */
}
.class .childclass {
  /* Some styles */
}
  • only 2 "parent child" pair can be in selector

  • Selecting html tags are only allowed when there are no scoped tags:

<div class="class">
  <h1>Heading</h1>
  <p>Paragraph</p>
</div>
<!-- you can select `.class h1` and `.class p` here -->
  • Ordering for a style group:

    1. Class
    2. Pseudo-elements
    3. Pseudo-classes
  • Order of pseudo-elements:

    1. before
    2. after
    3. first-line
    4. first-letter
    5. selection
    6. marker
  • Order of pseudo-classes:

    1. hover
    2. click
  • Order of properties:

.class {
  /* Margin and padding */
  /* Display (Flex, grid, etc.) */
  /* Background */
  /* Shadows */
}