diff --git a/package.json b/package.json index 68436d90..2016ebb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "1.0.40", + "version": "1.0.41", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu/" diff --git a/src/stories/Intro/Theming.stories.ts b/src/stories/Intro/Theming.stories.ts new file mode 100644 index 00000000..8b332ae7 --- /dev/null +++ b/src/stories/Intro/Theming.stories.ts @@ -0,0 +1,37 @@ +import Theme from '../../types/Theme' +import DesignSystem from '../../types/DesignSystem' +import { SButton, SDivider } from '../../components' +import { switchTheme, setDesignSystem } from '../../utils' +import mainStore from '../../store' + +export default { + title: 'Design System/Intro/Theming (WIP)', + excludeStories: /.*Data$/ +} + +export const configurable = () => ({ + components: { SButton, SDivider }, + template: `
+

This feature has Work In Progress status

+
+

Theme:

+ {{ theme }} + {{ designSystem || 'default' }} +
+ +

You can check all components, these theme settings are applied to the whole library

+
`, + computed: { + theme: () => mainStore?.getters?.libraryTheme as Theme, + designSystem: () => mainStore?.getters?.libraryDesignSystem as DesignSystem + }, + methods: { + handleThemeChange: () => { + switchTheme() + }, + handleDesignSystemChange: (designSystem: DesignSystem) => { + const newDesignSystem = designSystem === DesignSystem.DEFAULT ? DesignSystem.NEUMORPHIC : DesignSystem.DEFAULT + setDesignSystem(newDesignSystem) + } + } +}) diff --git a/src/styles/neumorphism/button.scss b/src/styles/neumorphism/button.scss index d6ca3ab6..3476f8c1 100644 --- a/src/styles/neumorphism/button.scss +++ b/src/styles/neumorphism/button.scss @@ -84,8 +84,8 @@ $neu-button-tertiary-background-color: var(--s-color-utility-body) !default; $neu-button-tertiary-background-color-active: $neu-button-tertiary-background-color !default; $neu-button-tertiary-background-color-alternative: $neu-button-tertiary-background-color !default; // Tertiary button: text colors -$neu-button-tertiary-text-color: var(--s-color-base-content-secondary) !default; -$neu-button-tertiary-text-color-active: var(--s-color-base-content-primary) !default; +$neu-button-tertiary-text-color: var(--s-color-base-content-tertiary) !default; +$neu-button-tertiary-text-color-active: var(--s-color-base-content-secondary) !default; // Tertiary button: border colors $neu-button-tertiary-border-color: transparent !default; $neu-button-tertiary-border-color-active: $neu-button-tertiary-border-color !default; @@ -93,6 +93,21 @@ $neu-button-tertiary-border-color-active: $neu-button-tertiary-border-color !def $neu-button-tertiary-box-shadow: var(--s-shadow-element-pressed) !default; $neu-button-tertiary-box-shadow-pressed: var(--s-shadow-element) !default; $neu-button-tertiary-box-shadow-active: $neu-button-tertiary-box-shadow !default; +// Dark Theme: Tertiary button: box-shadow +$neu-button-tertiary-box-shadow--dark: var(--s-shadow-element-pressed--dark) !default; +$neu-button-tertiary-box-shadow-active--dark: $neu-button-tertiary-box-shadow--dark !default; + +:root { + --neu-button-tertiary-box-shadow: #{$neu-button-tertiary-box-shadow}; + --neu-button-tertiary-box-shadow-active: #{$neu-button-tertiary-box-shadow-active}; + --neu-button-tertiary-box-shadow--dark: #{$neu-button-tertiary-box-shadow--dark}; + --neu-button-tertiary-box-shadow-active--dark: #{$neu-button-tertiary-box-shadow-active--dark}; +} + +[design-system-theme="dark"] { + --neu-button-tertiary-box-shadow: #{$neu-button-tertiary-box-shadow--dark}; + --neu-button-tertiary-box-shadow-active: #{$neu-button-tertiary-box-shadow-active--dark}; +} // Action button: common $neu-button-action-border-width: 0px !default; @@ -272,7 +287,7 @@ $neu-button-padding-mini: 3px 6px !default; border-color: $neu-button-tertiary-border-color; border-style: $neu-button-tertiary-border-style; border-width: $neu-button-tertiary-border-width; - box-shadow: $neu-button-tertiary-box-shadow; + box-shadow: var(--neu-button-tertiary-box-shadow); color: $neu-button-tertiary-text-color; &:hover, &:focus, &.focusing, &:active, &.s-pressed { diff --git a/src/styles/table.scss b/src/styles/table.scss index b9cdb281..b1fdba4a 100644 --- a/src/styles/table.scss +++ b/src/styles/table.scss @@ -11,10 +11,10 @@ .el-table__body { tr { &.hover-row { - > td, - &.current-row > td, - &.el-table__row--striped > td, - &.el-table__row--striped.current-row > td { + > td.el-table__cell, + &.current-row > td.el-table__cell, + &.el-table__row--striped > td.el-table__cell, + &.el-table__row--striped.current-row > td.el-table__cell { background-color: var(--s-color-base-background-hover); border-left: none; border-right: none; @@ -46,8 +46,8 @@ } .el-table--group, .el-table--border, -.el-table th.is-leaf, -.el-table td, +.el-table th.el-table__cell.is-leaf, +.el-table td.el-table__cell, .el-table--border th { border-color: var(--s-color-base-border-secondary); }