diff --git a/apps/client/src/common/components/buttons/BaseButtonStyles.module.scss b/apps/client/src/common/components/buttons/BaseButtonStyles.module.scss deleted file mode 100644 index 0466b499c..000000000 --- a/apps/client/src/common/components/buttons/BaseButtonStyles.module.scss +++ /dev/null @@ -1,140 +0,0 @@ -.subtle { - background: $gray-1050; - color: $blue-400; - line-height: 1em; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $blue-500; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } -} - -.subtle-white { - background: $gray-1050; - color: $ui-white; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $ui-white; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } - - &:disabled { - background: $gray-1050; - } -} - -.primary { - background: $blue-700; - color: $ui-white; - - &:hover:not(:disabled):not(:active) { - background: $blue-600; - } - - &:active:not(:disabled) { - background: $blue-800; - border-color: $blue-900; - } - - &:disabled { - opacity: $viewer-opacity-disabled; - } -} - -.destructive { - background: $red-700; - color: $ui-white; - - &:hover:not(:disabled):not(:active) { - background: $red-600; - color: $ui-white; - } - - &:active:not(:disabled) { - background: $red-800; - border-color: $red-900; - } -} - -.subtle-destructive { - background: $gray-1050; - color: $red-400; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $red-500; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } -} - -.ghosted { - background: transparent; - color: $blue-500; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $blue-500; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } - - &:disabled { - opacity: $opacity-disabled; - } -} - -.ghosted-white { - background: transparent; - color: $ui-white; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $ui-white; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } - - &:disabled { - opacity: $opacity-disabled; - } -} - - -.ghosted-destructive { - background: transparent; - color: $red-500; - - &:hover:not(:disabled):not(:active) { - background: $gray-1000; - color: $red-500; - } - - &:active:not(:disabled) { - background: $gray-1100; - border-color: $gray-1250; - } - - &:disabled { - opacity: $opacity-disabled; - } -} diff --git a/apps/client/src/common/components/buttons/Button.module.scss b/apps/client/src/common/components/buttons/Button.module.scss index cc6dd04b7..028f9a7ff 100644 --- a/apps/client/src/common/components/buttons/Button.module.scss +++ b/apps/client/src/common/components/buttons/Button.module.scss @@ -1,5 +1,6 @@ -@use '@/theme/viewerDefs' as *; -@import './BaseButtonStyles.module.scss'; +@use './buttonVariants' as base; + +@include base.button-variants; .baseButton { position: relative; @@ -81,4 +82,3 @@ .fluid { width: 100%; } - diff --git a/apps/client/src/common/components/buttons/IconButton.module.scss b/apps/client/src/common/components/buttons/IconButton.module.scss index a1e9b9981..c9c096422 100644 --- a/apps/client/src/common/components/buttons/IconButton.module.scss +++ b/apps/client/src/common/components/buttons/IconButton.module.scss @@ -1,5 +1,6 @@ -@use '@/theme/viewerDefs' as *; -@import './BaseButtonStyles.module.scss'; +@use './buttonVariants' as base; + +@include base.button-variants; .baseIconButton { aspect-ratio: 1; diff --git a/apps/client/src/common/components/buttons/_buttonVariants.scss b/apps/client/src/common/components/buttons/_buttonVariants.scss new file mode 100644 index 000000000..c63363a2c --- /dev/null +++ b/apps/client/src/common/components/buttons/_buttonVariants.scss @@ -0,0 +1,144 @@ +@use '@/theme/themeTokens' as *; +@use '@/theme/viewerDefs' as *; + +@mixin button-variants { + .subtle { + background: $gray-1050; + color: $blue-400; + line-height: 1em; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $blue-500; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + } + + .subtle-white { + background: $gray-1050; + color: $ui-white; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $ui-white; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + + &:disabled { + background: $gray-1050; + } + } + + .primary { + background: $blue-700; + color: $ui-white; + + &:hover:not(:disabled):not(:active) { + background: $blue-600; + } + + &:active:not(:disabled) { + background: $blue-800; + border-color: $blue-900; + } + + &:disabled { + opacity: $viewer-opacity-disabled; + } + } + + .destructive { + background: $red-700; + color: $ui-white; + + &:hover:not(:disabled):not(:active) { + background: $red-600; + color: $ui-white; + } + + &:active:not(:disabled) { + background: $red-800; + border-color: $red-900; + } + } + + .subtle-destructive { + background: $gray-1050; + color: $red-400; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $red-500; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + } + + .ghosted { + background: transparent; + color: $blue-500; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $blue-500; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + + &:disabled { + opacity: $opacity-disabled; + } + } + + .ghosted-white { + background: transparent; + color: $ui-white; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $ui-white; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + + &:disabled { + opacity: $opacity-disabled; + } + } + + .ghosted-destructive { + background: transparent; + color: $red-500; + + &:hover:not(:disabled):not(:active) { + background: $gray-1000; + color: $red-500; + } + + &:active:not(:disabled) { + background: $gray-1100; + border-color: $gray-1250; + } + + &:disabled { + opacity: $opacity-disabled; + } + } +} diff --git a/apps/client/src/theme/_themeTokens.scss b/apps/client/src/theme/_themeTokens.scss new file mode 100644 index 000000000..6ed01adc7 --- /dev/null +++ b/apps/client/src/theme/_themeTokens.scss @@ -0,0 +1,3 @@ +@forward 'ontimeColours'; +@forward 'ontimeStyles'; +@forward 'mixins'; diff --git a/apps/client/vite.config.js b/apps/client/vite.config.js index baafa3079..b9e42ff7d 100644 --- a/apps/client/vite.config.js +++ b/apps/client/vite.config.js @@ -110,9 +110,7 @@ export default defineConfig({ preprocessorOptions: { scss: { additionalData: ` - @use '@/theme/ontimeColours' as *; - @use '@/theme/ontimeStyles' as *; - @use '@/theme/mixins' as *; + @use '@/theme/themeTokens' as *; `, }, },