Patterns for Practical CSS Custom Properties Use | CSS-Tricks - CSS-Tricks

PHOTO EMBED

Sun Nov 27 2022 03:51:21 GMT+0000 (Coordinated Universal Time)

Saved by @danlourenco #css

.message {
  background-color: var(--student-background, #fff);
  color: var(--student-color, #000);
  font-family: var(--student-font, "Times New Roman", serif);
  margin-bottom: 10px;
  padding: 10px;
}

[data-student-theme="rachel"] {
  --student-background: rgb(43, 25, 61);
  --student-color: rgb(252, 249, 249);
  --student-font: Arial, sans-serif;
}

[data-student-theme="jen"] {
  --student-background: #d55349;
  --student-color: #000;
  --student-font: Avenir, Helvetica, sans-serif;
}

[data-student-theme="tyler"] {
  --student-background: blue;
  --student-color: yellow;
  --student-font: "Comic Sans MS", "Comic Sans", cursive;
}
content_copyCOPY

https://css-tricks.com/patterns-for-practical-css-custom-properties-use/