diff --git a/src/Box/Box.module.styl b/src/Box/Box.module.styl index 65ca148..8842be4 100644 --- a/src/Box/Box.module.styl +++ b/src/Box/Box.module.styl @@ -1,9 +1,9 @@ @import "../config" .box - background $foregroundLight + background nativeRGB(var(--theme-50)) @media (prefers-color-scheme dark) - background $foregroundDark + background nativeRGB(var(--gray-800)) border-radius 16px &.noBottomBorder border-radius 16px 16px 0 0 @@ -31,6 +31,6 @@ width 24px height 24px display inline-block - background $main + background nativeRGB(var(--theme-color)) border-radius 4px margin-right 8px diff --git a/src/Breadcrumb/Breadcrumb.module.styl b/src/Breadcrumb/Breadcrumb.module.styl index e9ab9e8..1a7d03a 100644 --- a/src/Breadcrumb/Breadcrumb.module.styl +++ b/src/Breadcrumb/Breadcrumb.module.styl @@ -1,3 +1,5 @@ +@import "../config" + .breadcrumb ol display flex display inline-flex @@ -14,3 +16,8 @@ .item padding 0 16px + +.chevron + color nativeRGB(var(--theme-500)) + @media (prefers-color-scheme dark) + color white diff --git a/src/Breadcrumb/index.tsx b/src/Breadcrumb/index.tsx index 6b09f38..74a8e7a 100644 --- a/src/Breadcrumb/index.tsx +++ b/src/Breadcrumb/index.tsx @@ -31,7 +31,7 @@ export default class Breadcrumb extends React.Component { {this.props.items.map((el, index) => (
  • - + {el.href ? ( {el.display} diff --git a/src/Button/Button.module.styl b/src/Button/Button.module.styl index 0206035..b14bb91 100644 --- a/src/Button/Button.module.styl +++ b/src/Button/Button.module.styl @@ -16,8 +16,8 @@ border none justify-content center align-items center - color $textOnMain - background-color $main + color white + background-color nativeRGB(var(--theme-color)) // Chrome Specific outline none @@ -29,12 +29,12 @@ &.ghost &:hover box-shadow none - background-color rgba($main, .25) + background-color nativeRGBA(var(--theme-500), .2) &:active &:focus - background-color $main - color $textOnMain + background-color nativeRGB(var(--theme-color)) + color white &.outline border 2px solid @background-color @@ -45,7 +45,7 @@ &:not(:disabled) &:active &:focus - color $textOnMain + color white &.ghost @@ -56,11 +56,11 @@ &:hover background-color @background-color - box-shadow 0 0 0 4px rgba(@background-color,.2) + box-shadow 0 0 0 4px nativeRGBA(var(--theme-500), .2) &:active &:focus - background-color darken(@background-color, 30%) + background-color nativeRGB(var(--theme-800)) &.block display flex @@ -86,8 +86,8 @@ margin-top 0 &:disabled - background $lightGrayLight - color $darkGrayLight + background nativeRGB(var(--gray-500)) + color nativeRGB(var(--gray-500)) transform none box-shadow none cursor initial @@ -97,11 +97,11 @@ color $darkGrayDark &.outline - border 2px solid @color + border 2px solid nativeRGB(var(--gray-500)) background transparent @media (prefers-color-scheme dark) - border 2px solid $darkGrayDark + border 2px solid nativeRGB(var(--gray-500)) &.loading color transparent @@ -111,8 +111,8 @@ &::after content "" display block - border $textOnMain 2px solid - border-color transparent transparent $textOnMain $textOnMain + border white 2px solid + border-color transparent transparent white white width 1em position absolute top calc(50% - (1em / 2)) @@ -122,10 +122,11 @@ box-sizing inherit animation ButtonLoading .75s infinite linear - &:disabled::after - border-color transparent transparent $darkGrayLight $darkGrayLight - @media (prefers-color-scheme dark) - border-color transparent transparent $darkGrayDark $darkGrayDark + // &:disabled::after + // $rgb = nativeRGB(var(--gray-500)) + // border-color transparent transparent $rgb $rgb + // @media (prefers-color-scheme dark) + // border-color transparent transparent $rgb $rgb svg + .textInner margin-left 8px @@ -161,7 +162,7 @@ btn($color, $theme) if $theme is 'darken' &:active &:focus - background-color darken(@color, 30%) + background-color nativeRGB(var(--theme-700)) &.ghost @@ -170,7 +171,7 @@ btn($color, $theme) &:hover box-shadow none - background-color rgba($color, .25) + background-color nativeRGBA($color, .25) &:active &:focus @@ -178,40 +179,20 @@ btn($color, $theme) &:hover background-color @background-color - box-shadow 0 4px 4px rgba(@background-color,.2) + box-shadow 0 4px 4px nativeRGBA(@background-color,.2) &:active &:focus if $theme is 'darken' - background-color darken(@background-color, 30%) + background-color nativeRGB(var(--theme-700)) else - background-color lighten(@background-color, 30%) + background-color nativeRGB(var(--theme-300)) &.loading color transparent &::after border-color transparent transparent $textColor $textColor -.info:not(:disabled) - btn($infoLight, 'darken') - @media (prefers-color-scheme dark) - btn($infoDark, 'lighten') - -.success:not(:disabled) - btn($successLight, 'darken') - @media (prefers-color-scheme dark) - btn($successDark, 'lighten') - -.error:not(:disabled) - btn($errorLight, 'darken') - @media (prefers-color-scheme dark) - btn($errorDark, 'lighten') - -.warning:not(:disabled) - btn($warningLight, 'darken') - @media (prefers-color-scheme dark) - btn($warningDark, 'lighten') - @keyframes ButtonLoading 0% transform rotate(0) diff --git a/src/Checkbox/Checkbox.module.styl b/src/Checkbox/Checkbox.module.styl index af6138d..e36646a 100644 --- a/src/Checkbox/Checkbox.module.styl +++ b/src/Checkbox/Checkbox.module.styl @@ -20,9 +20,9 @@ $backColor = #757575 width 20px height @width position relative - box-shadow inset 0 0 0 2px $darkGrayLight + box-shadow inset 0 0 0 2px nativeRGB(var(--gray-600)) @media (prefers-color-scheme dark) - box-shadow inset 0 0 0 2px $darkGrayDark + box-shadow inset 0 0 0 2px nativeRGB(var(--gray-400)) border-radius 4px transition all $transition @@ -30,7 +30,7 @@ $backColor = #757575 border-radius 20px position absolute transition all $transition - background $main + background nativeRGB(var(--theme-color)) svg transition $transition @@ -46,11 +46,8 @@ $backColor = #757575 opacity 0 &:checked + span - background $infoLight - box-shadow inset 0 0 0 2px $infoLight - @media (prefers-color-scheme dark) - box-shadow inset 0 0 0 2px $infoDark - background $infoDark + background nativeRGB(var(--theme-500)) + box-shadow inset 0 0 0 2px nativeRGB(var(--theme-500)) svg color white @@ -59,9 +56,7 @@ $backColor = #757575 &:hover span - box-shadow inset 0 0 0 2px $infoLight - @media (prefers-color-scheme dark) - box-shadow inset 0 0 0 2px $infoDark + box-shadow inset 0 0 0 2px nativeRGB(var(--theme-500)) .radio span @@ -85,9 +80,7 @@ $backColor = #757575 &:hover span box-shadow none &::after - background $darkGrayLight - @media (prefers-color-scheme dark) - background $darkGrayDark + background nativeRGB(var(--theme-500)) span width 24px @@ -95,19 +88,14 @@ $backColor = #757575 border-radius 20px margin-right 10px box-shadow none - background rgba($darkGrayLight, .3) - @media (prefers-color-scheme dark) - background rgba($darkGrayDark, .3) - + background nativeRGB(var(--gray-500)) &::after content " " top 50% transform translate(-50%, -50%) left 0 - background $darkGrayLight - @media (prefers-color-scheme dark) - background $darkGrayDark + background nativeRGB(var(--gray-600)) width 20px height @width @@ -118,44 +106,8 @@ $backColor = #757575 &:checked + span box-shadow none - background rgba($infoLight, .3) - @media (prefers-color-scheme dark) - background rgba($infoDark, .3) + background nativeRGB(var(--theme-300)) &::after left 100% transform translate(-50%, -50%) - background $infoLight - @media (prefers-color-scheme dark) - background $infoDark - -checkBox($color) - input:checked + span - background rgba($color, .5) - box-shadow inset 0 0 0 2px $color - - &::after - background $color - input:focus:checked + span - box-shadow inset 0 0 0 2px $color, 0 0 0 2px rgba($color,.3) - &.switch - input:checked + span - box-shadow none -.info - checkBox($infoLight) - @media (prefers-color-scheme dark) - checkBox($infoDark) - -.success - checkBox($successLight) - @media (prefers-color-scheme dark) - checkBox($successDark) - -.error - checkBox($errorLight) - @media (prefers-color-scheme dark) - checkBox($errorDark) - -.warning - checkBox($warningLight) - @media (prefers-color-scheme dark) - checkBox($warningDark) + background nativeRGB(var(--theme-500)) diff --git a/src/Code/Code.module.styl b/src/Code/Code.module.styl index 3addbe4..d152eb7 100644 --- a/src/Code/Code.module.styl +++ b/src/Code/Code.module.styl @@ -1,12 +1,13 @@ -@import "../config.styl" +@import "../config" .code .pre - background $lightGrayLight + background nativeRGB(var(--theme-50)) padding 4px 8px border-radius 8px @media (prefers-color-scheme dark) - background $lightGrayDark + background nativeRGB(var(--gray-700)) + color white .pre display block diff --git a/src/Fieldset/Fieldset.module.styl b/src/Fieldset/Fieldset.module.styl index 3f0c7e6..5fec660 100644 --- a/src/Fieldset/Fieldset.module.styl +++ b/src/Fieldset/Fieldset.module.styl @@ -1,8 +1,8 @@ @import '../config.styl' .fieldset - border-radius 4px - border 2px solid $grayDark + border-radius 8px + border 2px solid nativeRGB(var(--gray-500)) transition all $transition margin 0 @@ -12,8 +12,3 @@ padding 0 4px @media (prefers-color-scheme dark) color white - &:hover - border-color black - - @media (prefers-color-scheme dark) - border-color white diff --git a/src/Footer/Footer.module.styl b/src/Footer/Footer.module.styl index 1e37d23..f75a7f9 100644 --- a/src/Footer/Footer.module.styl +++ b/src/Footer/Footer.module.styl @@ -2,9 +2,9 @@ .footer padding 24px 0 - background $foregroundLight + background nativeRGB(var(--theme-50)) @media (prefers-color-scheme dark) - background $foregroundDark + background nativeRGB(var(--gray-800)) ul padding 0 diff --git a/src/GradientBackground/GradientBackground.module.styl b/src/GradientBackground/GradientBackground.module.styl deleted file mode 100644 index 05faf3f..0000000 --- a/src/GradientBackground/GradientBackground.module.styl +++ /dev/null @@ -1,30 +0,0 @@ -@import "../config" - -$percent = 15% - -.back - transition all $transition - background $mainGradient - - &.fullscreen > :first-child - min-height 100vh - -.info - background linear-gradient(to right, $infoLight, lighten($infoLight, $percent)) - @media (prefers-color-scheme dark) - background linear-gradient(to right, $infoDark, darken($infoDark, $percent)) - -.success - background linear-gradient(to right, $successLight, lighten($successLight, $percent)) - @media (prefers-color-scheme dark) - background linear-gradient(to right, $successDark, darken($successDark, $percent)) - -.error - background linear-gradient(to right, $errorLight, lighten($errorLight, $percent)) - @media (prefers-color-scheme dark) - background linear-gradient(to right, $errorDark, darken($errorDark, $percent)) - -.warning - background linear-gradient(to right, $warningLight, lighten($warningLight, $percent)) - @media (prefers-color-scheme dark) - background linear-gradient(to right, $warningDark, darken($warningDark, $percent)) diff --git a/src/GradientBackground/index.tsx b/src/GradientBackground/index.tsx deleted file mode 100644 index 0b4758e..0000000 --- a/src/GradientBackground/index.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react' -import { ColorType } from '../interfaces' - -import { buildClassName } from '../Util' -import css from './GradientBackground.module.styl' - -interface Props { - color?: ColorType - className?: string - children: React.ReactNode - fullscreen?: boolean -} - -/** - * Make the background a linear-gradient - * - * @version 1.0.2 - */ -export default class GradientBackground extends React.Component { - - public render = () => ( -
    - {this.props.children} -
    - ) - -} diff --git a/src/Input/Input.module.styl b/src/Input/Input.module.styl index 18b0c3f..d992ac6 100644 --- a/src/Input/Input.module.styl +++ b/src/Input/Input.module.styl @@ -22,9 +22,9 @@ svg position absolute user-select none - color $darkGrayLight + color black @media (prefers-color-scheme dark) - color $darkGrayDark + color white transition color $transition pointer-events none &.iconClickable @@ -44,10 +44,10 @@ appearance none option - background $foregroundLight + background nativeRGB(var(--theme-50)) color black @media (prefers-color-scheme dark) - background lighten($foregroundDark, 5%) + background nativeRGB(var(--gray-800)) color white textarea @@ -101,17 +101,17 @@ max-width 100% font-size .875rem outline none - background $lightGrayLight + background nativeRGB(var(--theme-50)) transition all $transition border 2px solid black color black @media (prefers-color-scheme dark) - background $lightGrayDark + background nativeRGB(var(--gray-800)) border-color transparent + border 2px solid nativeRGB(var(--gray-500)) color white &::placeholder - font-weight 700 font-size rem(16) transition color $transition opacity 1 @@ -125,10 +125,7 @@ &:disabled - border-color $darkGrayLight - - @media (prefers-color-scheme dark) - border-color $darkGrayDark + border-color nativeRGB(var(--gray-500)) &:not(:disabled) &:hover @@ -143,7 +140,7 @@ @media (prefers-color-scheme dark) color white &:focus - border-color $main + border-color nativeRGB(var(--theme-color)) ~ svg color @border-color @@ -153,18 +150,6 @@ // @media (prefers-color-scheme dark) // color white - &:invalid - border-color $errorLight - - ~ svg - color @border-color - @media (prefers-color-scheme dark) - border-color $errorDark - - ~ svg - color @border-color - - &.iconLeft padding-left 16px + 24px + 10px &.iconRight diff --git a/src/Input/Input.stories.tsx b/src/Input/Input.stories.tsx index 990704f..ffb48fb 100644 --- a/src/Input/Input.stories.tsx +++ b/src/Input/Input.stories.tsx @@ -23,7 +23,9 @@ tmp.args = { id: 'pouet', type: 'number', step: 10, - defaultValue: 'test' + defaultValue: 'test', + placeholder: 'test', + disabled: false } export const Normal = tmp diff --git a/src/Input/index.tsx b/src/Input/index.tsx index acb2d59..7e58bf3 100644 --- a/src/Input/index.tsx +++ b/src/Input/index.tsx @@ -53,6 +53,8 @@ interface Props extends React.DetailedHTMLProps