Skip to content

Commit

Permalink
fix(docs): moved from sass vars to css vars in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NikGurev committed Sep 19, 2024
1 parent e985eed commit d1f55a8
Show file tree
Hide file tree
Showing 21 changed files with 222 additions and 266 deletions.
9 changes: 4 additions & 5 deletions apps/docs/src/app/components/anchors/_anchors-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common';

@mixin kbq-docs-anchors-theme($theme) {
$foreground: map.get($theme, foreground);
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

$shadow: theming.kbq-color($foreground, text-less-contrast);
@mixin kbq-docs-anchors-theme() {
$shadow: var(--kbq-foreground-text-less-contrast);

.docs-anchors {
background-color: theming.kbq-color($background, bg);
background-color: var(--kbq-background-bg);
}

.docs-anchors__link {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
@use 'sass:map';

@use '../dist/components/core/styles/theming';
@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-component-viewer-theme($theme) {
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-component-viewer-theme() {
.docs-component-header {
background: map.get($background, bg);
background: var(--kbq-background-bg);
}

.docs-api__section {
border-color: map.get($background, contrast-fade);
border-color: var(--kbq-background-contrast-fade);
}

.docs-api__section_directive .docs-api_method-name {
color: map.get(map.get($theme, line), warning) !important;
color: var(--kbq-line-warning) !important;
}

.docs-api__input-marker {
color: map.get(map.get($theme, line), success) !important;
color: var(--kbq-line-success) !important;
}

.kbq-docs-table {
Expand All @@ -33,7 +33,7 @@
}
}

@mixin kbq-docs-component-viewer-typography($config) {
@mixin kbq-docs-component-viewer-typography() {
// header
.docs-component-name {
font-family: Inter;
Expand Down Expand Up @@ -102,22 +102,22 @@
}

.docs-component-navbar .kbq-tab-link {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}

.docs-api__class-selector-name,
.docs-api__input-marker,
.docs-api_property-name {
@include typography.kbq-typography-level-to-styles($config, mono-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, mono-big);
}

.docs-api_method-name {
@include typography.kbq-typography-level-to-styles($config, mono-big-strong);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, mono-big-strong);
}

.docs-api {
.kbq-markdown__code {
@include typography.kbq-typography-level-to-styles($config, mono-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, mono-big);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
@use 'sass:map';

@use '../dist/components/core/styles/theming';
@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-example-source-theme($theme) {
$foreground: map.get($theme, foreground);
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-example-source-theme() {
.docs-example-source__code {
background: theming.kbq-color($background, background-less-contrast);
background: var(--kbq-background-background-less-contrast);
}

.docs-example-source__numbers {
background: theming.kbq-color($background, background-less-contrast);
color: theming.kbq-color($foreground, text-disabled);
background: var(--kbq-background-background-less-contrast);
color: var(--kbq-foreground-text-disabled);
}
}

@mixin kbq-docs-example-source-typography($config) {
@mixin kbq-docs-example-source-typography() {
.docs-example-source__code,
.docs-example-source__numbers {
@include typography.kbq-typography-level-to-styles($config, body-mono);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, body-mono);

font-size: 14px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@use 'sass:map';

@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-live-example-viewer-theme($theme) {
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-live-example-viewer-theme() {
.docs-live-example__container {
border: 1px solid map.get($background, contrast-fade);
border: 1px solid var(--kbq-background-contrast-fade);
}

.docs-live-example__footer {
border-top: 1px solid map.get($background, contrast-fade);
border-top: 1px solid var(--kbq-background-contrast-fade);
}
}

@mixin kbq-docs-live-example-viewer-typography($config) {
@mixin kbq-docs-live-example-viewer-typography() {
.docs-live-example__footer,
.docs-live-example__footer .kbq-link {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}
}
18 changes: 9 additions & 9 deletions apps/docs/src/app/components/footer/_footer-theme.scss
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
@use 'sass:map';

@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-footer-theme($theme) {
$foreground: map.get($theme, foreground);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-footer-theme() {
.docs-footer__label,
.kbq-dropdown__group-header .kbq-caps-compact-strong {
color: map.get($foreground, contrast-secondary);
color: var(--kbq-foreground-contrast-secondary);
}
}

@mixin kbq-docs-footer-typography($config) {
@mixin kbq-docs-footer-typography() {
.docs-footer__label {
@include typography.kbq-typography-level-to-styles($config, text-normal);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-normal);
}

.docs-footer__control {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}

.docs-dropdown {
.kbq-dropdown-item__text {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}

.kbq-dropdown-item__caption {
@include typography.kbq-typography-level-to-styles($config, text-normal);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-normal);
}
}
}
15 changes: 7 additions & 8 deletions apps/docs/src/app/components/navbar/_navbar-theme.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
@use 'sass:map';

@use '../dist/components/core/styles/theming';
@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-navbar-theme($theme) {
$background: map.get($theme, background);
$foreground: map.get($theme, foreground);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-navbar-theme() {
.docs-navbar {
background: map.get($background, bg);
background: var(--kbq-background-bg);

.docs-navbar__github-icon svg {
fill: map.get($foreground, contrast);
fill: var(--kbq-foreground-contrast);
}
}
}

@mixin kbq-docs-navbar-typography($config) {
@mixin kbq-docs-navbar-typography() {
.docs-sidenav {
@include typography.kbq-typography-level-to-styles($config, subheading);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, subheading);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@use 'sass:map';

@mixin kbq-docs-page-not-found-theme($theme) {
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-page-not-found-theme() {
.page-not-found {
background: map.get($background, bg);
background: var(--kbq-background-bg);
}
}
26 changes: 12 additions & 14 deletions apps/docs/src/app/components/sidenav/_sidenav-theme.scss
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
@use 'sass:map';

@use '../dist/components/core/styles/theming';
@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-sidenav-theme($theme) {
$background: map.get($theme, background);
$foreground: map.get($theme, foreground);
$states-background: map.get(map.get($theme, states), background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-sidenav-theme() {
.docs-sidenav {
background-color: map.get($background, bg-secondary);
background-color: var(--kbq-background-bg-secondary);

.docs-sidenav__header-text path {
fill: map.get($foreground, contrast);
fill: var(--kbq-foreground-contrast);
}

.kbq-tree-option:hover {
background: map.get($states-background, transparent-hover);
background: var(--kbq-states-background-transparent-hover);
}

.kbq-tree-option.kbq-selected,
.kbq-tree-option.kbq-selected:hover {
background: map.get($states-background, transparent-active);
background: var(--kbq-states-background-transparent-active);
}
}

@media (width <= 768px) {
.docs-sidenav {
background-color: map.get($background, bg);
background-color: var(--kbq-background-bg);
}
}
}

@mixin kbq-docs-sidenav-typography($config) {
@mixin kbq-docs-sidenav-typography() {
.docs-sidenav {
.docs-sidenav__category-text {
@include typography.kbq-typography-level-to-styles($config, subheading);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, subheading);
}
}

.docs-navbar__anchor .kbq-button {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}

@media (width <= 768px) {
.docs-sidenav__category {
@include typography.kbq-typography-level-to-styles($config, title);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, title);
}
}
}
22 changes: 11 additions & 11 deletions apps/docs/src/app/components/welcome/_welcome-theme.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
@use 'sass:map';

@use '../dist/components/core/styles/typography';
@use '../dist/components/core/styles/common/tokens';

@mixin kbq-docs-welcome-theme($theme) {
$foreground: map.get($theme, foreground);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-welcome-theme() {
.docs-footer__label {
color: map.get($foreground, contrast-secondary);
color: var(--kbq-foreground-contrast-secondary);
}

.docs-welcome__category-item-title {
color: map.get($foreground, contrast-secondary);
color: var(--kbq-foreground-contrast-secondary);
}

.docs-welcome__category-item:hover {
.docs-welcome__category-item-title {
color: map.get($theme, states, foreground, theme-hover);
color: var(--kbq-states-foreground-theme-hover);
}
}

.docs-welcome__category-item:focus {
border-color: map.get(map.get($theme, states), focused-color);
border-color: var(--kbq-states-focused-color);
}
}

@mixin kbq-docs-welcome-typography($config) {
@mixin kbq-docs-welcome-typography() {
.docs-welcome__header {
font-family: Inter;
font-size: 36px;
Expand All @@ -38,14 +38,14 @@
}

.docs-welcome__description {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}

.docs-welcome__category-title {
@include typography.kbq-typography-level-to-styles($config, title);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, title);
}

.docs-welcome__category-item-title {
@include typography.kbq-typography-level-to-styles($config, text-big);
@include tokens.kbq-typography-level-to-styles_css-variables(typography, text-big);
}
}
10 changes: 4 additions & 6 deletions apps/docs/src/app/containers/docs-app/_docs-app-theme.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
@use 'sass:map';

@mixin kbq-docs-app-theme($theme) {
$background: map.get($theme, background);
/* stylelint-disable no-unknown-custom-properties */

@mixin kbq-docs-app-theme() {
.docs-overlay {
background: map.get($background, overlay);
background: var(--kbq-background-overlay);
}

.kbq-markdown__code,
.kbq-markdown__pre {
background: map.get($background, bg-secondary) !important;
background: var(--kbq-background-bg-secondary) !important;
}

.docs-top-overflown {
Expand Down
Loading

0 comments on commit d1f55a8

Please sign in to comment.