From c7e55fe3e031c0786e8a2fa77bc31ba374151f05 Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Sat, 13 Aug 2022 19:38:27 +0300 Subject: [PATCH] feat: Change docs color set to apply Automatisch colors --- .../docs/pages/.vitepress/theme/custom.css | 116 ++++++++++++++++++ packages/docs/pages/.vitepress/theme/index.js | 3 + 2 files changed, 119 insertions(+) create mode 100644 packages/docs/pages/.vitepress/theme/custom.css create mode 100644 packages/docs/pages/.vitepress/theme/index.js diff --git a/packages/docs/pages/.vitepress/theme/custom.css b/packages/docs/pages/.vitepress/theme/custom.css new file mode 100644 index 00000000..4cc4f15e --- /dev/null +++ b/packages/docs/pages/.vitepress/theme/custom.css @@ -0,0 +1,116 @@ +/** + * Colors + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-brand: #0059f7; + --vp-c-brand-light: #4789ff; + --vp-c-brand-lighter: #7eacff; + --vp-c-brand-lightest: #a5c5ff; + --vp-c-brand-dark: #001f52; + --vp-c-brand-darker: #001639; + --vp-c-brand-dimm: rgba(100, 108, 255, 0.08); +} + +/** + * Component: Button + * -------------------------------------------------------------------------- */ + +:root { + --vp-button-brand-border: var(--vp-c-brand-light); + --vp-button-brand-text: var(--vp-c-text-dark-1); + --vp-button-brand-bg: var(--vp-c-brand); + --vp-button-brand-hover-border: var(--vp-c-brand-light); + --vp-button-brand-hover-text: var(--vp-c-text-dark-1); + --vp-button-brand-hover-bg: var(--vp-c-brand-light); + --vp-button-brand-active-border: var(--vp-c-brand-light); + --vp-button-brand-active-text: var(--vp-c-text-dark-1); + --vp-button-brand-active-bg: var(--vp-button-brand-bg); +} + +/** + * Component: Home + * -------------------------------------------------------------------------- */ + +:root { + --vp-home-hero-name-color: transparent; + --vp-home-hero-name-background: -webkit-linear-gradient( + 120deg, + #bd34fe 30%, + #41d1ff + ); + + --vp-home-hero-image-background-image: linear-gradient( + -45deg, + #bd34fe 50%, + #47caff 50% + ); + --vp-home-hero-image-filter: blur(40px); +} + +@media (min-width: 640px) { + :root { + --vp-home-hero-image-filter: blur(56px); + } +} + +@media (min-width: 960px) { + :root { + --vp-home-hero-image-filter: blur(72px); + } +} + +/** + * Component: Custom Block + * -------------------------------------------------------------------------- */ + +:root { + --vp-custom-block-tip-border: var(--vp-c-brand); + --vp-custom-block-tip-text: var(--vp-c-brand-darker); + --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); +} + +.dark { + --vp-custom-block-tip-border: var(--vp-c-brand); + --vp-custom-block-tip-text: var(--vp-c-brand-lightest); + --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); +} + +/** + * Component: Algolia + * -------------------------------------------------------------------------- */ + +.DocSearch { + --docsearch-primary-color: var(--vp-c-brand) !important; +} + +/** + * VitePress: Custom fix + * -------------------------------------------------------------------------- */ + +/* + Use lighter colors for links in dark mode for a11y. + Also specify some classes twice to have higher specificity + over scoped class data attribute. +*/ +.dark .vp-doc a, +.dark .vp-doc a > code, +.dark .VPNavBarMenuLink.VPNavBarMenuLink:hover, +.dark .VPNavBarMenuLink.VPNavBarMenuLink.active, +.dark .link.link:hover, +.dark .link.link.active, +.dark .edit-link-button.edit-link-button, +.dark .pager-link .title { + color: var(--vp-c-brand-lighter); +} + +.dark .vp-doc a:hover, +.dark .vp-doc a > code:hover { + color: var(--vp-c-brand-lightest); + opacity: 1; +} + +/* Transition by color instead of opacity */ +.dark .vp-doc .custom-block a { + transition: color 0.25s; +} diff --git a/packages/docs/pages/.vitepress/theme/index.js b/packages/docs/pages/.vitepress/theme/index.js new file mode 100644 index 00000000..d4dbe3da --- /dev/null +++ b/packages/docs/pages/.vitepress/theme/index.js @@ -0,0 +1,3 @@ +import DefaultTheme from 'vitepress/theme'; +import './custom.css'; +export default DefaultTheme;