Skip to content

Commit

Permalink
Merge pull request #784 from mapbox/fix-bold
Browse files Browse the repository at this point in the history
force txt-bold to be 1em line height, fixes line height offsets, clos…
  • Loading branch information
samanpwbb authored May 26, 2017
2 parents 8a97b51 + b2f9b57 commit 11e44cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
22 changes: 13 additions & 9 deletions src/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ textarea {
font-size: 90%; /* mono fonts have naturally large proportions, scale them down to match open sans. */
}

/**
* Apply a bold font weight.
*
* @memberof Type utils
* @example
* <div class='txt-bold'>txt-bold</div>
*/
.txt-bold {
font-weight: bold !important;
/* prevent bold text inside inline text from offsetting line height */
line-height: 1em;
}

/**
* Classes for font size and line height, lists, block quotes, code blocks, and more.
*
Expand Down Expand Up @@ -376,15 +389,6 @@ textarea {
font-weight: normal !important;
}

/**
* Apply a bold font weight.
*
* @memberof Type utils
* @example
* <div class='txt-bold'>txt-bold</div>
*/
.txt-bold { font-weight: bold !important; }

/**
* Italicize text.
*
Expand Down
10 changes: 8 additions & 2 deletions test/__snapshots__/build-css.jest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ textarea{
font-family:'Menlo', 'Bitstream Vera Sans Mono', 'Monaco', 'Consolas', monospace;
font-size:90%;
}
.txt-bold{
font-weight:bold !important;
line-height:1em;
}
.txt-h1{
font-size:45px;
line-height:54px;
Expand Down Expand Up @@ -393,7 +397,6 @@ textarea{
.txt-normal{
font-weight:normal !important;
}
.txt-bold{ font-weight:bold !important; }
.txt-em{ font-style:italic !important; }
.txt-uppercase{ text-transform:uppercase !important; }
.txt-lowercase{ text-transform:lowercase !important; }
Expand Down Expand Up @@ -16732,6 +16735,10 @@ textarea{
font-family:'Menlo', 'Bitstream Vera Sans Mono', 'Monaco', 'Consolas', monospace;
font-size:90%;
}
.txt-bold{
font-weight:bold !important;
line-height:1em;
}
.txt-h1{
font-size:45px;
line-height:54px;
Expand Down Expand Up @@ -16861,7 +16868,6 @@ textarea{
.txt-normal{
font-weight:normal !important;
}
.txt-bold{ font-weight:bold !important; }
.txt-em{ font-style:italic !important; }
.txt-uppercase{ text-transform:uppercase !important; }
.txt-lowercase{ text-transform:lowercase !important; }
Expand Down

0 comments on commit 11e44cb

Please sign in to comment.