Skip to content

Commit

Permalink
feat(firefox): remove dotted line for good
Browse files Browse the repository at this point in the history
affects: @fremtind/jkl-accordion, @fremtind/jkl-button, @fremtind/jkl-core, @fremtind/jkl-dropdown,
@fremtind/jkl-hamburger, @fremtind/portal
  • Loading branch information
Leiv Fredrik Berge committed Aug 1, 2019
1 parent 9e26f74 commit 67187a6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 38 deletions.
4 changes: 0 additions & 4 deletions packages/accordion/accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ $chevron-weight--hover: rem(2px);
font-family: inherit;
background-color: inherit;
color: inherit; // stops Safari from changing color on :active
/* fix dotted border on keyboard focus in Firefox: */
&:-moz-focusring {
outline: 0;
}

border: $border-width solid transparent;
padding: $title-vertical-padding ($horizontal-padding - $border-width);
Expand Down
9 changes: 0 additions & 9 deletions packages/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ $button-height--small: 2.5rem;
transition: transform $animation-timing;
position: relative;

// get rid of dotted border on Firefox
&::-moz-focus-inner {
border: 0;
}

&:-moz-focusring {
outline: none;
}

html:not([data-mousenavigation]) &:focus,
&:hover {
transform: scale(1.05);
Expand Down
3 changes: 0 additions & 3 deletions packages/core/links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
.jkl-link {
appearance: none;
outline: none;
:-moz-focusring {
outline: none;
}
color: currentColor;

&--inline {
Expand Down
32 changes: 26 additions & 6 deletions packages/core/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,34 @@ button::-moz-focus-inner,
}

/**
* Restore the focus styles unset by the previous rule.
* Remove dotted lines around object, especially for firefox
*/

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
a:hover,
a:active,
a:focus,
a:link,
a:visited {
outline: 0;
outline: 0 !important;
outline-style: none;
}

button,
object,
embed {
outline: 0;
}

/* All Input elements */
input::-moz-focus-inner {
outline: 0;
}

/* Or more specifically*/
input[type="submit"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner {
outline: 0;
}

/**
Expand Down
4 changes: 0 additions & 4 deletions packages/dropdown/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ $dropdown-total-height: $label-height + $value-height + $bottom-padding;
&::ms-expand {
display: none;
}
/* remove Firefox dotted border */
&::-moz-focus-inner {
outline: none !important;
}
&:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 $border-color;
Expand Down
8 changes: 0 additions & 8 deletions packages/hamburger/hamburger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ $button-focus-ring-color: $himmel;
height: 100%;
width: 100%;

&:-moz-focusring {
outline: none !important;
}

&::-moz-focus-inner {
border: 0;
}

&:hover,
&--is-active:hover {
opacity: 0.7;
Expand Down
4 changes: 0 additions & 4 deletions portal/src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ $portal-max-width: 1200px;
@include small-device {
margin: 0 $component-spacing--large;
}

:-moz-focusring {
outline: none;
}
}
}

Expand Down

0 comments on commit 67187a6

Please sign in to comment.