liveBook · Manning

Color palette

As explained in Tiny CSS Projects

The SMACSS theme category contains styles defining the visual look and feel of a page or project.

A color palette establishes a page’s visual tone and supports a consistent theme. It commonly coordinates colors with fonts, borders, and spacing, while often reflecting a logo or brand identity. section 4.1 section 11.1.2

Choose palette colors as part of the theme rather than changing them with screen width. Apply shared text colors through inheritable properties where possible, then override controls or other exceptions deliberately. section 4.1 section 8.0

A practical palette can coordinate:

  • A primary color and an accent color for visual emphasis. section 10.3.1
  • Text, links, buttons, inputs, error messages, and headings across the interface. section 8.2
  • Fallback colors for effects that may require a separate image-based declaration. section 10.3.1

Checkout input border

Use the primary and accent colors in a linear gradient for an input’s bottom border. Keep a solid color fallback, then apply the gradient through border-image. This gives the form a recognizable visual relationship with the rest of the application. section 10.3.1

Listing 10.4 Styling input fields that aren’t of type radio or checkbox
input:not([type="radio"], [type="checkbox"]) {
 
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  border: none;                                                             #1
  border-bottom: solid 1px var(--primary);                                  #2
  border-image: linear-gradient(to right, var(--primary), var(--accent)) 1; #3
  padding: 0 0 .25rem;
  width: 100%;
}

Inspect the complete input rule to see palette colors applied with inherited typography, a fallback border, and a primary-to-accent gradient. section 10.3.1

How Tiny CSS Projects covers it

How deep it goes
Explains palette roles, inheritance, responsive stability, and a gradient-border implementation, stopping short of formal color-system design.
Examples
Uses a responsive newspaper theme, checkout controls, and a primary-to-accent gradient on text-input borders.
What it assumes
Assumes basic CSS declarations and selectors while teaching inheritance, fallback colors, and theme consistency through examples.
What you can do after
Apply it via CSS by defining reusable theme colors and using them consistently across controls, text, borders, and layouts.
How it connects
Connects color palettes to themes, CSS inheritance, responsive design, branding, typography, and SMACSS.

Also explained in

Compare how 11 books explain color palette →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Tiny CSS Projects. The section links point to the parts of the book it draws on.