Skip to content

Commit

Permalink
Rework focus and selection styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-lhuillier committed May 4, 2019
1 parent 58855b4 commit 8fbe7b3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/app-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ $height: 1.75rem;
}
&:focus {
box-shadow: none;
background-color: $soft-white;
&:after {
@include outline-chrome;
background-color: $gray-light;
Expand Down
6 changes: 6 additions & 0 deletions src/components/base-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export default {
position: absolute;
left: 0;
right: 0;
margin-top: 1px;
box-shadow: $shadow;
z-index: 1;
Expand All @@ -190,6 +191,11 @@ export default {
color: $soft-white;
background-color: $gray-light;
}
&:focus {
z-index: 1;
position: relative;
}
}
}
</style>
4 changes: 1 addition & 3 deletions src/sass/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Mimick default chrome outline on focus
@mixin outline-chrome {
outline: none;
border: 1px solid #4d90fe;
-webkit-box-shadow: 0px 0px 5px #4d90fe;
box-shadow: 0px 0px 5px #4d90fe;
box-shadow: 0 0 0 1px $color-brand, 0 0 5px $color-brand;
}
8 changes: 8 additions & 0 deletions src/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ body {
line-height: $line-height-base;
}

:focus {
@include outline-chrome;
}

::selection {
background-color: rgba($color-brand, 0.75);
}

// Utilities
.ml-auto {
margin-left: auto !important;
Expand Down

0 comments on commit 8fbe7b3

Please sign in to comment.