-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(theme): improve color system #2797
Conversation
Good point 😳 Indeed it looks too busy on the first screens shot. Also, dashed underline might be seen as abbr text too 🤔
For the root-level, no, I don't have any good ideas. But, I think you only need the indicator when there is linked root level menu, and non-linked static root level menu. If all the root level menu is clickable, user should know by hovering the label. Like in GitBook Docs. Though, still even in GitBook docs the section title is not link. For top main menu, maybe we should add "Return to top" or change its name to the page title 🤔 But most of the docs I see don't have the top level in here, like Laravel, Tailwind, GitBook, Nuxt. So I'm not sure why people really want this feature 👀 |
I was more thinking of how to distinguish which item in those menus is the current selection (in the screenshots it's "Getting started" in the side pane menu and "Reference" in the top main menu) |
it seems to be there for me: ![]() which browser+version are you on? or are you emulating achromatopsia and want something like underline/box there? (similar to #2100): ![]() |
Yes, only relying on colors it not the most accessible It's also why I proposed adding icons to the callouts to distinguish between info/warning/danger/tip (especially when the callout title is overridden) |
Line highlighting in code blocks in light mode looks weird (unrelated to this PR). I'll try swapping out with shikiji, so other themes don't break, and we can still change the default to adaptive themes. I'll also port some more stuff from #2100 back to here. Edit: On second thoughts, lets skip shikiji for now. I'll have to make many changes to shiki-processor since lineOptions are dropped in shikiji. |
I found that some colors are not fully optimized for light theme (Yellow and green) while creating mockups in Figma. Please hold on this PR. Making adjustments. |
@brc-dd Updated! And, updated the description as well. Please have a look at it one more time. For me this is review ready. And I've also rethought and made UI more border-less. Now we can remove Also, due to now we are having light themed code blocks, we can delete |
Links don't have sufficient contrast on hover. Instead of changing the color, we probably can change decoration / offset on hover? |
At last, finalize the color system of VitePress. The focus is to have good contrast ratio (a11y) and ease of theme customization.
VitePress Color System
I've refined the color system, and defined basics. The colors in VitePress have following "functional" colors.
Brand colors have exact same color scale system with 3 levels of solid colors with different brightness, and 1 soft color.
XXX-1
: The most solid color used mainly for colored text. It must satisfy the contrast ratio against when used on top ofXXX-soft
.XXX-2
: The color used mainly for hover state of the button.XXX-3
: The color for solid background, such as bg color of the button. It must satisfy the contrast ratio with pure white (#ffffff) text on top of it.XXX-soft
: The color used for subtle background such as custom container or badges. It must satisfy the contrast ratio when puttingXXX-1
colors on top of it.Now every where in the app uses these colors. So, the minimum work users needs to do when customizing VitePress theme, is to set 5 colors. For example, if we set
green
as a brand color, it can be used for Vue related project docs (e.g. Vue Router).Reduced CSS vars across the app
I've updated, and removed styles that were not being used. I kept
--vp-c-brand
as deprecated since people would be using this (it is aliased to--vp-c-brand-1
).