Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(design): update theming docs to include regular and theme switch usage #3526

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

xelaint
Copy link
Member

@xelaint xelaint commented Feb 26, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Current theming docs doesn't explain how to use components w/o theme switching. The theme switching docs is also missing some critical information.

Fixes: #3521

What is the new behavior?

Add docs for regulars usage of the daff-theme mixin. Clarify usage of mixin in light and dark modes.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@xelaint xelaint added the package: design @daffodil/design label Feb 26, 2025
@xelaint xelaint requested a review from a team as a code owner February 26, 2025 21:45
@xelaint xelaint requested a review from damienwebdev February 26, 2025 21:45
The design system includes three core palettes that reflect Daffodil's brand identity, three palettes used to indicate status, and a neutral palette that is dominant throughout the design system. These palettes are built using [HSLuv](https://www.hsluv.org/), a color space designed as a human-friendly alternative to the standard HSL. It aims to address the limitations of traidtional color spaces like RGB and HSL.
The default Daffodil design system theme features three core palettes that define's Daffodil's brand identity, three status indicating palettes, and a neutral palette that is dominant throughout the design system. These palettes are built using [HSLuv](https://www.hsluv.org/), a perceptually uniform color space designed to be more human-friendly than traditional models like RGB and HSL. By addressing the inconsistencies of conventional color spaces, HSLuv ensures predictable contrast and visual harmony.

Each palette consists of a collection of [perceptually uniform colors](https://programmingdesignsystems.com/color/perceptually-uniform-color-spaces/) with consistent contrast ratios, enhancing accessibility and usability across the design system. These palettes are represented as Sass maps, where each individual color value is referred to as a **hue**.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the existing palettes in the codebase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damienwebdev How do I link it? _color-palettes.scss does not get generated in docs.


.daff-theme-dark {
@include daff.daff-theme(daff.$theme-dark);
html {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no html.

Copy link
Member Author

@xelaint xelaint Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So where should the theme be included?

@@ -49,28 +49,26 @@ There is a minimal required global style for the Daffodil Design System to opera
> For more information on our approach to these kinds of styles, see the [Global Styles guide.](/libs/design/guides/foundations/global-styles.md)

## Add a theme
A theme must be configured in order for the components to work properly. The components in the design library can be configured with customized colors in addition to a dark and light mode for those same colors.
A theme must be configured in order for Daffodil Design components to work properly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Daffodil Design sounds awkward, maybe just always reference the package name? @daffodil/design?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between Daffodil Design and @daffodil/design? Reading it, it sounds the same. I don't think the design system should always be referred to via the package name. That's a very developer thing, and the design system is not exclusively catered to developers.

@xelaint xelaint requested a review from damienwebdev March 3, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: design @daffodil/design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOCS] Document how to use theme without using the theme switch feature
2 participants