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

fix(theme): use--vp-c-tip- CSS variable for badge/block colors with typetip #3434

Merged
merged 4 commits into from Jan 12, 2024
Merged

fix(theme): use--vp-c-tip- CSS variable for badge/block colors with typetip #3434

merged 4 commits into from Jan 12, 2024

Conversation

larsrickert
Copy link
Contributor

@larsrickert larsrickert commented Jan 10, 2024

tl;dr;: The CSS variables --vp-c-gray, --vp-c-indigo, --vp-c-green, --vp-c-yellow and --vp-c-red should not be directly used for components. Instead only --vp-c-default --vp-c-brand --vp-c-tip --vp-c-success --vp-c-warning and --vp-c-danger should to allow custom themes to easily use custom colors.

Some CSS variables for components (such as badge, custom block and code block) directly used the CSS variables of the color palette (such as --vp-c-yellow) instead of the generic variables (--vp-c-warning etc.).

This lead to the issue that a custom theme can not simply add its own colors for (success/green, danger/red, warning/yellow and tip/purple) because it would not have been applied to all components.

Note that this is not a breaking change since the changed variables in this PR all default to the same values as before but now a custom theme can easily add its own color palette, by e.g. defining it like:

  --vp-c-tip-1: <custom-color>;
  --vp-c-tip-2: <custom-color>;
  --vp-c-tip-3: <custom-color>;
  --vp-c-tip-soft: <custom-color>;

The background and text color of the badge and custom block with type `tip` had invalid CSS variable values because they used the brand colors which is invalid.

There are existing `--vp-c-tip-` variables that default to the brand colors that should be used for those components so the tip color can easily be overridden in a custom theme.
@larsrickert larsrickert changed the title fix(theme): use tip colors for badge/block with type tip fix(theme): use--vp-c-tip- CSS variable for badge/block colors with typetip Jan 10, 2024
@brc-dd brc-dd merged commit 78abf47 into vuejs:main Jan 12, 2024
7 checks passed
@larsrickert larsrickert deleted the patch-1 branch January 12, 2024 10:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants