Skip to content

Commit

Permalink
fix: enhance line-height handling on #button and #input reset
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed May 6, 2019
1 parent ad9475b commit 6d5f0b0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,12 @@ exports[`Button scss have to match snapshot 1`] = `
padding: 0;
border: var(--button-border-width) solid transparent;
border-radius: var(--button-border-radius);
font-size: var(--button-font-size);
line-height: var(--button-height);
text-decoration: none;
/* Firefox includes a hidden border which messes up button dimensions */ }
.dnb-button,
.dnb-core-style .dnb-button {
font-size: var(--button-font-size);
line-height: var(--button-height); }
.dnb-button__icon {
line-height: 1em; }
.dnb-button__icon:not(.dnb-icon) svg:not([width]):not([height]) {
Expand Down
7 changes: 5 additions & 2 deletions packages/dnb-ui-lib/src/components/button/style/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
border: var(--button-border-width) solid transparent;
border-radius: var(--button-border-radius);

font-size: var(--button-font-size);
line-height: var(--button-height);
&,
.dnb-core-style & {
font-size: var(--button-font-size);
line-height: var(--button-height);
}
text-decoration: none;

&__icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,12 @@ exports[`InputMasked scss have to match snapshot 1`] = `
padding: 0;
border: var(--button-border-width) solid transparent;
border-radius: var(--button-border-radius);
font-size: var(--button-font-size);
line-height: var(--button-height);
text-decoration: none;
/* Firefox includes a hidden border which messes up button dimensions */ }
.dnb-button,
.dnb-core-style .dnb-button {
font-size: var(--button-font-size);
line-height: var(--button-height); }
.dnb-button__icon {
line-height: 1em; }
.dnb-button__icon:not(.dnb-icon) svg:not([width]):not([height]) {
Expand Down Expand Up @@ -629,8 +631,7 @@ a.dnb-button:active, a.dnb-button:focus {
align-items: flex-start;
vertical-align: middle;
width: auto;
font-size: var(--input-font-size);
font-weight: var(--font-weight-default); }
font-size: var(--input-font-size); }
.dnb-input__shell {
position: relative;
display: flex;
Expand All @@ -653,7 +654,7 @@ a.dnb-button:active, a.dnb-button:focus {
padding: var(--input-padding);
text-align: left;
color: inherit;
font-size: var(--input-font-size);
font-size: inherit;
line-height: 1em;
background-color: transparent;
transform: translateY(var(--input-border-width)); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,12 @@ exports[`Input scss have to match snapshot 1`] = `
padding: 0;
border: var(--button-border-width) solid transparent;
border-radius: var(--button-border-radius);
font-size: var(--button-font-size);
line-height: var(--button-height);
text-decoration: none;
/* Firefox includes a hidden border which messes up button dimensions */ }
.dnb-button,
.dnb-core-style .dnb-button {
font-size: var(--button-font-size);
line-height: var(--button-height); }
.dnb-button__icon {
line-height: 1em; }
.dnb-button__icon:not(.dnb-icon) svg:not([width]):not([height]) {
Expand Down Expand Up @@ -1010,8 +1012,7 @@ a.dnb-button:active, a.dnb-button:focus {
align-items: flex-start;
vertical-align: middle;
width: auto;
font-size: var(--input-font-size);
font-weight: var(--font-weight-default); }
font-size: var(--input-font-size); }
.dnb-input__shell {
position: relative;
display: flex;
Expand All @@ -1034,7 +1035,7 @@ a.dnb-button:active, a.dnb-button:focus {
padding: var(--input-padding);
text-align: left;
color: inherit;
font-size: var(--input-font-size);
font-size: inherit;
line-height: 1em;
background-color: transparent;
transform: translateY(var(--input-border-width)); }
Expand Down
3 changes: 1 addition & 2 deletions packages/dnb-ui-lib/src/components/input/style/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
width: auto;

font-size: var(--input-font-size);
font-weight: var(--font-weight-default);

&__shell {
position: relative;
Expand Down Expand Up @@ -67,7 +66,7 @@
text-align: left;

color: inherit;
font-size: var(--input-font-size);
font-size: inherit;
line-height: 1em; // because when ::selected is kikking in
background-color: transparent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,12 @@ exports[`Modal scss have to match snapshot 1`] = `
padding: 0;
border: var(--button-border-width) solid transparent;
border-radius: var(--button-border-radius);
font-size: var(--button-font-size);
line-height: var(--button-height);
text-decoration: none;
/* Firefox includes a hidden border which messes up button dimensions */ }
.dnb-button,
.dnb-core-style .dnb-button {
font-size: var(--button-font-size);
line-height: var(--button-height); }
.dnb-button__icon {
line-height: 1em; }
.dnb-button__icon:not(.dnb-icon) svg:not([width]):not([height]) {
Expand Down

0 comments on commit 6d5f0b0

Please sign in to comment.