Skip to content

Commit

Permalink
Standardize font sizes on works page (#8931)
Browse files Browse the repository at this point in the history
Co-authored-by: Drini Cami <[email protected]>
  • Loading branch information
Achorn and cdrini authored Apr 26, 2024
1 parent 6a1b173 commit 2827e41
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 23 deletions.
4 changes: 2 additions & 2 deletions openlibrary/templates/type/edition/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
$else:
$ overview_desc = work.description
<div class="book-description read-more">
<div class="read-more__content" style="max-height:58px">
<div class="read-more__content" style="max-height:81px">
$:sanitize(format(overview_desc))
</div>
$:macros.ReadMore()
Expand Down Expand Up @@ -464,7 +464,7 @@ <h4>$_("First Sentence")</h4>
$if work.description and work.description != overview_desc:
<h4>$_("Work Description")</h4>
<div class="work-description read-more">
<div class="read-more__content" style="max-height:58px">
<div class="read-more__content" style="max-height:81px">
$:sanitize(format(work.description))
</div>
$:macros.ReadMore()
Expand Down
4 changes: 2 additions & 2 deletions static/css/base/headings.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ h1 {
}

h2 {
font-size: 1.375em;
font-size: @font-size-title-large;
&.author {
color: @brown;
font-size: 1.125em;
Expand Down Expand Up @@ -68,7 +68,7 @@ h2 {
}

h3 {
font-size: 1.0em;
font-size: @font-size-label-medium;
&.Question {
font-family: @georgia_serif-1;
font-size: 1.2em;
Expand Down
2 changes: 1 addition & 1 deletion static/css/components/carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Badly named. Should be renamed "carousel-heading" or similar.
.home-h2 {
font-size: 1.2em;
font-size: @font-size-title-medium;
font-weight: normal;
color: @link-blue;
margin-bottom: .5em;
Expand Down
2 changes: 1 addition & 1 deletion static/css/components/edit-toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ div#editInfo {
white-space: normal;
text-align: right;
> div {
font-size: 11px;
font-size: @font-size-label-small;
font-weight: normal;
color: @brown !important;
font-family: @lucida_sans_serif-1;
Expand Down
6 changes: 3 additions & 3 deletions static/css/components/editions.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ table#editions,

th {
font-family: @news_gothic_sans_serif-2;
font-size: 11px;
font-size: @font-size-label-small;
font-weight: 600;
text-transform: uppercase;
line-height: normal;
Expand Down Expand Up @@ -56,14 +56,14 @@ table#editions,
}

div.title {
font-size: 1.0em;
font-size: @font-size-title-small;
padding: 10px 0;
min-width: 1%;
overflow-wrap: break-word;
}

div.links {
font-size: 12px;
font-size: @font-size-label-medium;
color: @dark-grey;
line-height: 1.5em;
}
Expand Down
2 changes: 1 addition & 1 deletion static/css/components/link-box.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
display: inline;
}
> div {
font-size: .75em;
font-size: @font-size-headline-small;
}
}

Expand Down
3 changes: 1 addition & 2 deletions static/css/components/readerStats.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.readers-stats {
color: @grey;
font-size: .9em;
font-size: @font-size-label-large;
margin-bottom: 20px;
li {
list-style-type: none;
Expand All @@ -16,7 +16,6 @@
content: "·";
margin: 0 4px;
}

}
.dot {
list-style-type: none;
Expand Down
7 changes: 3 additions & 4 deletions static/css/components/work-title-and-author.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
font-family: @georgia_serif-1;
margin: 10px 0 0;
color: @dark-grey;
font-size: 2em;
font-size: @font-size-headline-large;
overflow-wrap: break-word;
}
}
Expand All @@ -29,7 +29,7 @@
font-style: italic;
}
&.edition-byline {
font-size: 1em;
font-size: @font-size-title-medium;
font-weight: normal;
color: @dark-grey;
margin: 10px 0 20px;
Expand All @@ -46,7 +46,7 @@

.first-published-date {
color: @grey;
font-size: .8em;
font-size: @font-size-label-medium;
}
}

Expand Down Expand Up @@ -127,7 +127,6 @@
li.avg-ratings,
li.readers-stats__review-count {
font-size: .85em;

}

// On mobile only, the rating count text has parentheses around it
Expand Down
14 changes: 7 additions & 7 deletions static/css/components/work.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ div.editionAbout {

p {
margin: 1em 0;
font-size: 13px;
font-size: @font-size-body-medium;
}
p.book-description {
margin: 0;
Expand Down Expand Up @@ -91,7 +91,7 @@ textarea[name="edition--notes"] + h3 + .wmd-preview,
.edition-notes,
textarea[name="work--description"] + h3 + .wmd-preview,
.book-description {
font-size: .8rem;
font-size: @font-size-label-medium;
margin-top: 5px;
margin-bottom: 20px;

Expand Down Expand Up @@ -131,11 +131,11 @@ textarea[name="work--description"] + h3 + .wmd-preview,
}

.section, .section h6 {
font-size: .8em;
font-size: @font-size-label-medium;
}

h3.edition-header {
font-size: 14px;
font-size: @font-size-label-large;
margin: 0;
}

Expand Down Expand Up @@ -174,7 +174,7 @@ a.section-anchor {
}

.meta dt, .meta dd {
font-size: 12px;
font-size: @font-size-label-medium;
}

.book-subtitle{
Expand Down Expand Up @@ -255,14 +255,14 @@ div.editionTools {
margin: 0 4px;
border: 1px solid @lighter-grey;
border-radius: 5px;
font-size: .8em;
font-size: @font-size-body-medium;
word-break: break-word;
text-align: center;
min-width: 100px;

div {
margin-bottom: 4px;
font-size: .9em;
font-size: @font-size-label-medium;
color: @grey;
word-wrap: break-word;
}
Expand Down
19 changes: 19 additions & 0 deletions static/css/less/font-families.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,22 @@
@verdana: verdana, sans-serif;
@ichonochive: "Iconochive-Regular", sans-serif;
@bahnschrift: Bahnschrift, sans-serif;

@font-size-display-large: 57px;
@font-size-display-medium: 45px;
@font-size-display-small: 36px;

@font-size-headline-large: 32px;
@font-size-headline-medium: 28px;
@font-size-headline-small: 24px;

@font-size-title-large: 22px;
@font-size-title-medium: 16px;
@font-size-title-small: 14px;

@font-size-label-large: 14px;
@font-size-label-medium: 12px;
@font-size-label-small: 11px;

@font-size-body-large: 16px;
@font-size-body-medium: 14px;

0 comments on commit 2827e41

Please sign in to comment.