Skip to content

Conversation

jbrooksuk
Copy link
Member

Closes #78 and replaces #114.

Instead of allowing a whole bunch of confusing and overlapping theming options, I've opted to follow what Caleb Porzio has done in FluxUI and implement "accent colors".

Out of the box, it means that Cachet is less customizable in a big way. However, we can later extend customizability by implementing #122 and structuring the views in a way where they're easier to replace via Laravel's own publishing system.

Okay, let's get into how it works. Essentially, Cachet now generates new CSS variables for accents:

/* Light mode */
:root {
    --accent: 4, 193, 71;
    --accent-content: 4, 193, 71;
    --accent-foreground: 255, 255, 255;
    --accent-background: 250, 250, 250;
}

/* Dark mode */
@media(prefers-color-scheme: dark) {
    :root {
        --accent: 4, 193, 71;
        --accent-content: 79, 212, 126;
        --accent-foreground: 1, 58, 21;
        --accent-background: 24, 24, 27;
    }
}

These colors are used throughout the UI to "accent" elements such as buttons (accent) and links within content (accent-content).

Cachet is also utilizing Filament's own Color and FilamentColor classes to access the default Tailwind color palette. We also register Cachet's default color so that it's an option too. This means we don't need to touch our own CSS to generate them in a usable CSS variable format.

I've adjusted parts of the UI (mainly in dark mode) to change the color of panel backgrounds to automatically take on the background hue ✨

@jbrooksuk jbrooksuk merged commit c56a048 into main Dec 18, 2024
17 checks passed
@jbrooksuk jbrooksuk deleted the theme branch December 18, 2024 16:38
jbrooksuk added a commit that referenced this pull request Dec 22, 2024
* main: (86 commits)
  Update feature list
  Revert "Changing cachet media color dark to light" (#149)
  Changing cachet media color dark to light (#148)
  Adjust header padding for improved responsiveness (#146)
  Add comment
  Update development docs
  Update README.md
  Seed the default accents
  Compile Assets
  Accent Colors (#143)
  Remove unused `spatie/laravel-ray` dependency
  Configure run-tests on and schedule
  Run tests across MySQL, Postgres and SQLite (#142)
  Fix code styling
  Fix fetching of incident and schedule updateables
  Fix code styling
  Change integer types for status columns
  Compile Assets
  Update API endpoint descriptions
  Compile Assets
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme Settings

1 participant