Skip to content

Commit

Permalink
fix: hide placeholder on #input focus
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Mar 1, 2019
1 parent c5df673 commit 1d72d9b
Show file tree
Hide file tree
Showing 16 changed files with 10 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,6 @@ exports[`Button scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -893,8 +890,6 @@ exports[`Button scss have to match snapshot 1`] = `
.dnb-button ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-button :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-button details {
display: block; }
.dnb-button summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -983,8 +980,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
.dnb-form-label ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-label :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-label details {
display: block; }
.dnb-form-label summary {
Expand Down Expand Up @@ -1173,9 +1168,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1371,8 +1363,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
.dnb-form-status ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-status :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-status details {
display: block; }
.dnb-form-status summary {
Expand Down Expand Up @@ -1591,9 +1581,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1789,8 +1776,6 @@ exports[`Dropdown scss have to match snapshot 1`] = `
.dnb-dropdown ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-dropdown :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-dropdown details {
display: block; }
.dnb-dropdown summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@ exports[`FormLabel scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -494,8 +491,6 @@ exports[`FormLabel scss have to match snapshot 1`] = `
.dnb-form-label ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-label :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-label details {
display: block; }
.dnb-form-label summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@ exports[`FormStatus scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -543,8 +540,6 @@ exports[`FormStatus scss have to match snapshot 1`] = `
.dnb-form-status ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-status :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-status details {
display: block; }
.dnb-form-status summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ exports[`InputMasked scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -555,8 +552,6 @@ exports[`InputMasked scss have to match snapshot 1`] = `
.dnb-button ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-button :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-button details {
display: block; }
.dnb-button summary {
Expand Down Expand Up @@ -898,9 +893,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1096,8 +1088,6 @@ a.dnb-button {
.dnb-form-label ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-label :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-label details {
display: block; }
.dnb-form-label summary {
Expand Down Expand Up @@ -1286,9 +1276,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1484,8 +1471,6 @@ a.dnb-button {
.dnb-form-status ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-status :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-status details {
display: block; }
.dnb-form-status summary {
Expand Down Expand Up @@ -1704,9 +1689,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1902,8 +1884,6 @@ a.dnb-button {
.dnb-input ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-input :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-input details {
display: block; }
.dnb-input summary {
Expand Down Expand Up @@ -2178,9 +2158,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -2376,8 +2353,6 @@ a.dnb-button {
.dnb-input-masked ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-input-masked :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-input-masked details {
display: block; }
.dnb-input-masked summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ exports[`Input scss have to match default theme snapshot 1`] = `
background-color: var(--color-mint-green);
color: var(--input-text-color--focus);
text-shadow: none; }
.dnb-input__input:focus ~ .dnb-input__placeholder {
display: none; }
.dnb-input__shell[data-input-state='focus'][data-has-content='false'] .dnb-input__placeholder {
transition: color 100ms ease-out;
color: var(--color-sea-green-alt-30); }
display: none; }
"
`;

Expand Down Expand Up @@ -525,9 +526,6 @@ exports[`Input scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -723,8 +721,6 @@ exports[`Input scss have to match snapshot 1`] = `
.dnb-button ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-button :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-button details {
display: block; }
.dnb-button summary {
Expand Down Expand Up @@ -1066,9 +1062,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1264,8 +1257,6 @@ a.dnb-button {
.dnb-form-label ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-label :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-label details {
display: block; }
.dnb-form-label summary {
Expand Down Expand Up @@ -1454,9 +1445,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1652,8 +1640,6 @@ a.dnb-button {
.dnb-form-status ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-form-status :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-form-status details {
display: block; }
.dnb-form-status summary {
Expand Down Expand Up @@ -1872,9 +1858,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -2070,8 +2053,6 @@ a.dnb-button {
.dnb-input ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-input :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-input details {
display: block; }
.dnb-input summary {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@
text-shadow: none;
}

// Adjusting opacity of placeholder when:
// 1: input is in focus and 2. input has no content
// IE11 fallback - hide placeholder on focus
&__input:focus ~ .dnb-input__placeholder {
display: none;
}

// hide placeholder on focus
&__shell[data-input-state='focus'][data-has-content='false']
.dnb-input__placeholder {
transition: color 100ms ease-out;
color: var(--color-sea-green-alt-30);
display: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,6 @@ exports[`Logo scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -501,8 +498,6 @@ exports[`Logo scss have to match snapshot 1`] = `
.dnb-logo ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-logo :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-logo details {
display: block; }
.dnb-logo summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,6 @@ exports[`Modal scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -933,8 +930,6 @@ exports[`Modal scss have to match snapshot 1`] = `
.dnb-button ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-button :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-button details {
display: block; }
.dnb-button summary {
Expand Down Expand Up @@ -1272,9 +1267,6 @@ a.dnb-button {
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -1470,8 +1462,6 @@ a.dnb-button {
.dnb-modal ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-modal :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-modal details {
display: block; }
.dnb-modal summary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ exports[`Slider scss have to match snapshot 1`] = `
/**
* Remove the inner border and padding of focus outlines in Firefox.
*/
/**
* Restore the focus outline styles unset by the previous rule in Firefox.
*/
/* Interactive
*/
/*
Expand Down Expand Up @@ -515,8 +512,6 @@ exports[`Slider scss have to match snapshot 1`] = `
.dnb-slider ::-moz-focus-inner {
border-style: none;
padding: 0; }
.dnb-slider :-moz-focusring {
outline: 1px dotted ButtonText; }
.dnb-slider details {
display: block; }
.dnb-slider summary {
Expand Down
Loading

0 comments on commit 1d72d9b

Please sign in to comment.