From 5748f839712300146686db45406882257bfd81b9 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 1 Apr 2018 15:25:25 +0200 Subject: [PATCH] Use proper button groups Improve styling of button groups, so they're more intuitive. Remove button-group containers for single buttons. --- app/components/file-preview/component.js | 2 +- app/styles/_buttons.scss | 60 +++++++++++++++++++----- app/templates/inspect.hbs | 34 ++++++-------- 3 files changed, 63 insertions(+), 33 deletions(-) diff --git a/app/components/file-preview/component.js b/app/components/file-preview/component.js index ba40f5a..9e7d396 100644 --- a/app/components/file-preview/component.js +++ b/app/components/file-preview/component.js @@ -123,7 +123,7 @@ export default Component.extend({ showEditor: false }); }).catch(err => { - alert('Failed to update the file. Check the console for more info'); + alert('Failed to update the file. Check the console for more info.'); console.error(err); }); } else { diff --git a/app/styles/_buttons.scss b/app/styles/_buttons.scss index 55b3e90..65b5b50 100644 --- a/app/styles/_buttons.scss +++ b/app/styles/_buttons.scss @@ -1,24 +1,16 @@ -div.button-group { - display: inline-block; -} - -div.button-group + button, -div.button-group + div.button-group { - margin-left: 1rem; -} - header { + button, a.button { display: inline-block; padding: 0.4rem 0 0.3rem; - text-align: center; + width: 3rem; border: 1px solid $dark-grey-2; border-radius: 0.2em; background-color: #fff; color: $dark-grey-2; + text-align: center; font-size: 0.8rem; text-transform: uppercase; - width: 3rem; svg { height: 1rem; @@ -38,8 +30,8 @@ header { } } - &:disabled, - &:disabled:hover { + &:disabled:not(.active), + &:disabled:not(.active):hover { border-color: $dark-grey-3; background-color: #fff; color: $dark-grey-3; @@ -50,5 +42,47 @@ header { } } } + + &.active { + border-color: lighten($dark-grey-2, 10%); + background-color: lighten($dark-grey-2, 10%); + color: lighten($dark-grey-2, 10%); + + svg { + path { + fill: #fff; + } + } + } } + + button + .button-group, + .button-group + button, + .button-group + .button-group { + margin-left: 1rem; + } + + .button-group { + position: relative; + display: inline-flex; + flex-direction: row; + + button { + position: relative; + margin-right: 0; + flex: 0 1 auto; + + &:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + } + + button + button { + margin-left: -1px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + } + } diff --git a/app/templates/inspect.hbs b/app/templates/inspect.hbs index f557e58..048979f 100644 --- a/app/templates/inspect.hbs +++ b/app/templates/inspect.hbs @@ -1,26 +1,22 @@
{{breadcrumb-nav currentDirPath=currentDirPath}}