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 3, 2019
1 parent bc793dd commit 0042611
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 @@ -551,10 +551,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 @@ -268,10 +268,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 @@ -608,8 +610,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 @@ -632,7 +633,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 @@ -593,10 +593,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 @@ -933,8 +935,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 @@ -957,7 +958,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 @@ -644,10 +644,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 0042611

Please sign in to comment.