diff --git a/src/App.scss b/src/App.scss index 1f9bab40..27fee4b4 100644 --- a/src/App.scss +++ b/src/App.scss @@ -372,14 +372,24 @@ nav { } } +.menu-item { + border: none; + outline: none; + text-align: initial; + font-size: inherit; + font-family: inherit; + cursor: pointer; + color: inherit; +} + .button-unstyled { - background: none; border: none; outline: none; display: inline; text-align: initial; font-size: 100%; font-family: inherit; + box-shadow: var(--shadow); padding: 0; line-height: unset; cursor: pointer; @@ -393,13 +403,6 @@ nav { &.-fullwidth { width: 100%; } - - &.-hover-highlight { - &:hover svg { - color: $fallback--lightText; - color: var(--lightText, $fallback--lightText); - } - } } input, diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index ce19291a..1c3c1419 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -130,11 +130,6 @@ margin: -0.5em 0; padding: 0.5em 0; text-align: center; - - &:not(:hover) .icon { - color: $fallback--lightText; - color: var(--lightText, $fallback--lightText); - } } } diff --git a/src/components/button.style.js b/src/components/button.style.js index 5a5e4271..8d19516f 100644 --- a/src/components/button.style.js +++ b/src/components/button.style.js @@ -10,6 +10,14 @@ const border = (top, shadow) => ({ const buttonInsetFakeBorders = [border(true, false), border(false, true)] const inputInsetFakeBorders = [border(true, true), border(false, false)] +const buttonOuterShadow = { + x: 0, + y: 0, + blur: 2, + spread: 0, + color: '#000000', + alpha: 1 +} const hoverGlow = { x: 0, @@ -22,7 +30,7 @@ const hoverGlow = { export default { name: 'Button', // Name of the component - selector: '.button', // CSS selector/prefix + selector: '.button-default', // CSS selector/prefix // outOfTreeSelector: '' // out-of-tree selector is used when other components are laid over it but it's not part of the tree, see Underlay component // States, system witll calculate ALL possible combinations of those and prepend "normal" to them + standalone "normal" state states: { @@ -39,8 +47,8 @@ export default { // Variants are mutually exclusive, each component implicitly has "normal" variant, and all other variants inherit from it. variants: { // Variants save on computation time since adding new variant just adds one more "set". - normal: '-default', // you can override normal variant, it will be appenended to the main class - danger: '-default.danger' + // normal: '', // you can override normal variant, it will be appenended to the main class + danger: '.danger' // Overall the compuation difficulty is N*((1/6)M^3+M) where M is number of distinct states and N is number of variants. // This (currently) is further multipled by number of places where component can exist. }, @@ -56,21 +64,7 @@ export default { // like within it directives: { background: '--fg', - shadow: [{ - x: 0, - y: 0, - blur: 2, - spread: 0, - color: '#000000', - alpha: 1 - }, ...buttonInsetFakeBorders] - } - }, - { - variant: 'unstyled', - directives: { - background: '--fg', - opacity: 0 + shadow: [buttonOuterShadow, ...buttonInsetFakeBorders] } }, { @@ -82,7 +76,7 @@ export default { { state: ['pressed'], directives: { - shadow: [...inputInsetFakeBorders] + shadow: [buttonOuterShadow, ...inputInsetFakeBorders] } }, { @@ -95,7 +89,7 @@ export default { state: ['toggled'], directives: { background: '--accent,-24.2', - shadow: [...inputInsetFakeBorders] + shadow: [buttonOuterShadow, ...inputInsetFakeBorders] } }, { @@ -112,6 +106,13 @@ export default { shadow: [...buttonInsetFakeBorders] } }, + { + state: ['disabled', 'hover'], + directives: { + background: '$blend(--background, 0.25, --parent)', + shadow: [...buttonInsetFakeBorders] + } + }, { component: 'Text', parent: { @@ -122,6 +123,17 @@ export default { textOpacity: 0.25, textOpacityMode: 'blend' } + }, + { + component: 'Text', + parent: { + component: 'Button', + state: ['disabled', 'hover'] + }, + directives: { + textOpacity: 0.25, + textOpacityMode: 'blend' + } } ] } diff --git a/src/components/button_unstyled.style.js b/src/components/button_unstyled.style.js new file mode 100644 index 00000000..d0ca03a5 --- /dev/null +++ b/src/components/button_unstyled.style.js @@ -0,0 +1,88 @@ +export default { + name: 'ButtonUnstyled', + selector: '.button-unstyled', + states: { + disabled: ':disabled', + toggled: '.toggled', + pressed: ':active', + hover: ':hover', + focused: ':focus-within' + }, + validInnerComponents: [ + 'Text', + 'Icon' + ], + defaultRules: [ + { + directives: { + background: '--fg', + shadow: [], + opacity: 0 + } + }, + { + component: 'Icon', + parent: { + component: 'ButtonUnstyled', + state: ['hover'] + }, + directives: { + textColor: '--parent--text' + } + }, + { + component: 'Icon', + parent: { + component: 'ButtonUnstyled', + state: ['toggled'] + }, + directives: { + textColor: '--parent--text' + } + }, + { + component: 'Text', + parent: { + component: 'ButtonUnstyled', + state: ['disabled'] + }, + directives: { + textOpacity: 0.25, + textOpacityMode: 'blend' + } + }, + { + component: 'Text', + parent: { + component: 'ButtonUnstyled', + state: ['disabled', 'hover'] + }, + directives: { + textOpacity: 0.25, + textOpacityMode: 'blend' + } + }, + { + component: 'Icon', + parent: { + component: 'ButtonUnstyled', + state: ['disabled'] + }, + directives: { + textOpacity: 0.25, + textOpacityMode: 'blend' + } + }, + { + component: 'Icon', + parent: { + component: 'ButtonUnstyled', + state: ['disabled', 'hover'] + }, + directives: { + textOpacity: 0.25, + textOpacityMode: 'blend' + } + } + ] +} diff --git a/src/components/chat_message/chat_message.vue b/src/components/chat_message/chat_message.vue index 381574c3..166889d7 100644 --- a/src/components/chat_message/chat_message.vue +++ b/src/components/chat_message/chat_message.vue @@ -53,7 +53,7 @@