CSS-custom-properties-stuff
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>CSS-custom-properties-stuff</title>
  </head>

  <body>
    <div class="container">
      <h1 class="heading-large">CSS-custom-properties-stuff</h1>
      <article class="post">
        <h2 class="heading-medium">Using CSS variables as multipliers</h2>
        <p class="paragraph">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium
          numquam adipisci recusandae officiis dolore tenetur, nisi, beatae
          praesentium, soluta ullam suscipit quas?
        </p>
      </article>

      <article class="post">
        <h2 class="heading-medium">Using CSS variables as multipliers</h2>
        <p class="paragraph">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium
          numquam adipisci recusandae officiis dolore tenetur, nisi, beatae
          praesentium, soluta ullam suscipit quas?
        </p>
      </article>
    </div>

    <div class="container container-2">
      <h1 class="heading-large-2">CSS-custom-properties-stuff</h1>
      <article class="post post-2">
        <h2 class="heading-medium-2">Using CSS variables as multipliers</h2>
        <p class="paragraph">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium
          numquam adipisci recusandae officiis dolore tenetur, nisi, beatae
          praesentium, soluta ullam suscipit quas?
        </p>
      </article>

      <article class="post post-2">
        <h2 class="heading-medium-2">
          Using CSS variables for property values
        </h2>
        <p class="paragraph">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium
          numquam adipisci recusandae officiis dolore tenetur, nisi, beatae
          praesentium, soluta ullam suscipit quas?
        </p>
      </article>
    </div>
  </body>
</html>
/* global styles */

body {
  background-color: LavenderBlush;
  color: Teal;
  font-size: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.5;
  margin: 0;
  padding: 1rem;
}

*,
::after,
::before {
  box-sizing: border-box;
}

/* component variables */

:root {
  --spacing-multiplier: 1;
  --headings-multiplier: 1;
}

/* component variables on larger screens */

@media (min-width: 576px) {
  :root {
    --spacing-multiplier: 2;
    --headings-multiplier: 3 / 2;
  }
}

/* components styles */

.container {
  max-width: 480px;
  margin: 0 auto;
}

.post {
  background-color: white;
  border-radius: 16px;
  padding: calc(0.5rem * var(--spacing-multiplier))
    calc(1rem * var(--spacing-multiplier));
  margin: calc(0.5rem * var(--spacing-multiplier)) 0
    calc(1rem * var(--spacing-multiplier));
}

.heading-medium,
.heading-large {
  margin: 0;
}

.heading-medium {
  font-size: calc(2rem * var(--headings-multiplier));
}

.heading-large {
  font-size: calc(3rem * var(--headings-multiplier));
}



.container-2 {
  --small-spacing: 0.5rem;
  --large-spacing: 1rem;
  --large-font-size: 2rem;
  --medium-font-size: 1rem;
}

@media (min-width: 576px) {
  .container-2 {
    --small-spacing: 1rem;
    --large-spacing: 2rem;
    --large-font-size: 3rem;
    --medium-font-size: 2rem;
  }
}

.post-2 {
  padding: var(--small-spacing) var(--large-spacing);
  margin: var(--small-spacing) auto var(--large-spacing);
}

.heading-large-2 {
  font-size: var(--large-font-size);
}
.heading-medium-2 {
  font-size: var(--medium-font-size);
}

CSS-custom-properties-stuff

  • Arquivos
  • Index
  • Style
  • Script
  • README
  • CDN Adicionar
HTML
PLEASE WAIT...