Unverified Commit 79594cc6 authored by Lyza Gardner's avatar Lyza Gardner Committed by GitHub

Merge pull request #2233 from hypothesis/font-size-consolidation

Consolidate font sizes and line heights
parents 1a501b20 e4daac41
...@@ -109,9 +109,9 @@ $adder-transition-duration: 80ms; ...@@ -109,9 +109,9 @@ $adder-transition-duration: 80ms;
align-items: center; align-items: center;
border: none; border: none;
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: var.$annotator-adder-font-size;
font-family: sans-serif; font-family: sans-serif;
line-height: 1em; line-height: var.$annotator-adder-line-height;
padding: 10px; padding: 10px;
padding-bottom: 7px; padding-bottom: 7px;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
@use './bucket-bar'; @use './bucket-bar';
@use './highlights'; @use './highlights';
$annotator-font-size: 14px;
$sidebar-collapse-transition-time: 150ms; $sidebar-collapse-transition-time: 150ms;
// Sidebar // Sidebar
...@@ -35,8 +34,8 @@ $sidebar-collapse-transition-time: 150ms; ...@@ -35,8 +34,8 @@ $sidebar-collapse-transition-time: 150ms;
user-select: none; user-select: none;
direction: ltr; direction: ltr;
background: none; background: none;
font-size: $annotator-font-size; font-size: var.$annotator-base-font-size;
line-height: var.$base-line-height; line-height: var.$annotator-base-line-height;
height: 100%; height: 100%;
position: fixed; position: fixed;
top: 0; top: 0;
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
color: var.$color-text-light; color: var.$color-text-light;
font-weight: bold; font-weight: bold;
font-family: var.$sans-font-family; font-family: var.$sans-font-family;
font-size: 10px; font-size: var.$annotator-bucket-bar-font-size;
line-height: 14px; line-height: var.$annotator-bucket-bar-line-height;
margin: 0 auto; margin: 0 auto;
} }
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
@mixin primary-action-btn { @mixin primary-action-btn {
@include focus.outline-on-keyboard-focus; @include focus.outline-on-keyboard-focus;
@include var.font-normal;
color: var.$grey-1; color: var.$grey-1;
background-color: var.$grey-mid; background-color: var.$grey-mid;
height: 35px; height: 35px;
...@@ -57,7 +58,6 @@ ...@@ -57,7 +58,6 @@
border-radius: 2px; border-radius: 2px;
font-weight: bold; font-weight: bold;
font-size: var.$body1-font-size;
padding-left: 12px; padding-left: 12px;
padding-right: 12px; padding-right: 12px;
......
...@@ -24,19 +24,9 @@ ...@@ -24,19 +24,9 @@
margin-right: 0.5em; margin-right: 0.5em;
} }
&__subheader {
width: 100%;
text-align: center;
padding: 1em 0.5em;
border-bottom: 1px solid var.$grey-3;
font-size: 1.25em;
font-weight: 500;
color: var.$color-text-light;
}
&__title { &__title {
@include var.font-big;
color: var.$color-brand; color: var.$color-brand;
font-size: var.$body2-font-size;
font-weight: 700; font-weight: 700;
} }
......
@use "../../variables" as var; @use "../../variables" as var;
.annotation-document-info { .annotation-document-info {
font-size: 13px; @include var.font-normal;
color: var.$color-text-light; color: var.$color-text-light;
display: flex; display: flex;
...@@ -11,6 +11,5 @@ ...@@ -11,6 +11,5 @@
&__domain { &__domain {
margin-right: 5px; margin-right: 5px;
font-size: 12px;
} }
} }
...@@ -9,13 +9,9 @@ ...@@ -9,13 +9,9 @@
&__quote { &__quote {
@include var.font-normal; @include var.font-normal;
border-left: 3px solid var.$grey-3; border-left: 3px solid var.$grey-3;
color: var.$color-text-light; color: var.$color-text-light;
font-family: sans-serif;
font-size: 12px;
font-style: italic; font-style: italic;
letter-spacing: 0.1px;
padding: 0 1em; padding: 0 1em;
// Prevent long URLs etc. in quote causing overflow // Prevent long URLs etc. in quote causing overflow
......
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
} }
& .form-input { & .form-input {
@include var.font-small;
padding: 0.5em; padding: 0.5em;
border-radius: 0; border-radius: 0;
font-size: var.$small-font-size;
} }
&__permissions { &__permissions {
@include var.font-small;
margin: 0.5em 0; margin: 0.5em 0;
font-size: var.$small-font-size;
} }
&__arrow { &__arrow {
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
&__group, &__group,
&__private { &__private {
@include var.font-normal;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
font-size: var.$body1-font-size;
color: var.$color-text-light; color: var.$color-text-light;
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
} }
.autocomplete-list__items { .autocomplete-list__items {
@include var.font-normal;
@supports (clip-path: polygon(0 0, 100% 0, 0% 100%, 0% 100%)) { @supports (clip-path: polygon(0 0, 100% 0, 0% 100%, 0% 100%)) {
&:before { &:before {
/** /**
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
} }
} }
position: absolute; position: absolute;
font-size: var.$body2-font-size;
top: 5px; top: 5px;
max-width: 100%; max-width: 100%;
min-width: 10em; min-width: 10em;
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
z-index: 10; z-index: 10;
@media (pointer: coarse) { @media (pointer: coarse) {
font-size: var.$touch-target-size;
line-height: var.$touch-target-size; line-height: var.$touch-target-size;
} }
} }
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
.excerpt__toggle-link { .excerpt__toggle-link {
padding-left: 15px; padding-left: 15px;
background-image: linear-gradient(to right, transparent 0px, white 12px); background-image: linear-gradient(to right, transparent 0px, white 12px);
line-height: var.$normal-line-height;
} }
.excerpt__toggle-button { .excerpt__toggle-button {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
} }
.group-list__menu-label { .group-list__menu-label {
@include var.font-big;
align-items: center; align-items: center;
color: var.$color-text; color: var.$color-text;
display: flex; display: flex;
...@@ -12,8 +13,6 @@ ...@@ -12,8 +13,6 @@
// Prevent label from wrapping if top bar is too narrow to fit all of its // Prevent label from wrapping if top bar is too narrow to fit all of its
// items. // items.
flex-shrink: 0; flex-shrink: 0;
font-size: var.$body2-font-size;
font-weight: bold; font-weight: bold;
} }
......
...@@ -3,18 +3,17 @@ ...@@ -3,18 +3,17 @@
.help-panel { .help-panel {
&__sub-panel-title { &__sub-panel-title {
@include var.font-big;
margin: 0; margin: 0;
padding: 0.5em 0; padding: 0.5em 0;
font-size: 1.25em;
font-weight: 500; font-weight: 500;
} }
&__content { &__content {
@include var.font-normal;
padding: 0.5em; padding: 0.5em;
border-top: 1px solid var.$grey-3; border-top: 1px solid var.$grey-3;
border-bottom: 1px solid var.$grey-3; border-bottom: 1px solid var.$grey-3;
line-height: var.$normal-line-height;
font-size: var.$normal-font-size;
a { a {
text-decoration: underline; text-decoration: underline;
...@@ -52,11 +51,11 @@ ...@@ -52,11 +51,11 @@
align-items: center; align-items: center;
&__tab { &__tab {
@include var.font-big;
flex: 1 1 0px; flex: 1 1 0px;
margin-top: 0.5em; margin-top: 0.5em;
border-right: 1px solid var.$grey-3; border-right: 1px solid var.$grey-3;
text-align: center; text-align: center;
font-size: 1.25em;
color: var.$color-text-light; color: var.$color-text-light;
&:last-of-type { &:last-of-type {
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
} }
.logged-out-message__logo-icon { .logged-out-message__logo-icon {
font-size: 30px; width: 30px;
height: 30px;
color: var.$grey-mid; color: var.$grey-mid;
&:hover { &:hover {
......
...@@ -42,7 +42,7 @@ $toolbar-border: 0.1em solid var.$grey-3; ...@@ -42,7 +42,7 @@ $toolbar-border: 0.1em solid var.$grey-3;
} }
&.is-text { &.is-text {
font-size: 13px; @include var.font-normal;
} }
&-icon { &-icon {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
} }
.menu-section__heading { .menu-section__heading {
@include var.font-normal;
color: var.$color-text-light; color: var.$color-text-light;
font-size: var.$body1-font-size;
line-height: 1; line-height: 1;
margin: 1px 1px 0; margin: 1px 1px 0;
margin-bottom: 10px; margin-bottom: 10px;
......
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
// Content area of the menu. // Content area of the menu.
.menu__content { .menu__content {
@include var.font-big;
background-color: white; background-color: white;
border: 1px solid var.$grey-3; border: 1px solid var.$grey-3;
box-shadow: var.$popup-menu-shadow; box-shadow: var.$popup-menu-shadow;
font-size: var.$body2-font-size;
position: absolute; position: absolute;
top: calc(100% + 5px); top: calc(100% + 5px);
z-index: 1; z-index: 1;
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
$h-padding: 15px; $h-padding: 15px;
.moderation-banner { .moderation-banner {
@include var.font-normal;
position: relative; position: relative;
color: white; color: white;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
font-size: var.$normal-font-size;
font-weight: bold; font-weight: bold;
} }
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
.selection-tabs { .selection-tabs {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
color: var.$color-text-light;
@include var.font-normal; @include var.font-normal;
color: var.$color-text-light;
&:hover { &:hover {
color: var.$color-text; color: var.$color-text;
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
} }
.selection-tabs__count { .selection-tabs__count {
@include var.font-tiny;
position: relative; position: relative;
bottom: 3px; bottom: 3px;
font-size: 10px;
} }
.selection-tabs__empty-message { .selection-tabs__empty-message {
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
&__item { &__item {
display: flex; display: flex;
margin: 0.25em 0.5em 0.25em 0; margin: 0.25em 0.5em 0.25em 0;
line-height: var.$base-line-height;
} }
&__edit { &__edit {
...@@ -28,7 +27,7 @@ ...@@ -28,7 +27,7 @@
border: 1px solid var.$grey-3; border: 1px solid var.$grey-3;
border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;
border-right-width: 0; border-right-width: 0;
padding: 0 0.5em; padding: 2px 0.5em;
} }
&__delete { &__delete {
......
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
&__item { &__item {
margin: 0.25em 0.5em 0.25em 0; margin: 0.25em 0.5em 0.25em 0;
padding: 0 0.5em; padding: 2px 0.5em;
line-height: var.$base-line-height;
background: var.$grey-0; background: var.$grey-0;
border: 1px solid var.$grey-3; border: 1px solid var.$grey-3;
border-radius: 2px; border-radius: 2px;
......
@use "../../variables" as var;
// Tooltips
// --------
// Custom tooltips that appear instantly, replacing the browser's default
// tooltip
@mixin tooltip-arrow($rotation) {
transform: rotate($rotation);
background: var.$grey-7;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
border-right: 1px solid rgba(0, 0, 0, 0.2);
content: '';
display: block;
height: 6px;
left: 0;
margin-left: auto;
margin-right: 5px;
position: absolute;
right: 0;
width: 6px;
}
// The tooltip background
.tooltip {
@include var.font-small;
border-radius: 2px;
position: fixed;
background-color: var.$grey-7;
color: white;
font-weight: bold;
padding-left: 5px;
padding-right: 5px;
padding-top: 4px;
padding-bottom: 4px;
z-index: var.$zindex-tooltip;
}
// Arrow at the bottom of the tooltip pointing at the target element
// Variant for tooltips above the target that point down at it
.tooltip--down:before {
@include tooltip-arrow(45deg);
content: '';
top: calc(100% - 5px);
}
// Variant for tooltips below the target that point up at it
.tooltip--up:before {
@include tooltip-arrow(225deg);
content: '';
top: -3px;
}
// The text content inside the tooltip
.tooltip-label {
// Make the label a positioned element so that it appears _above_ the
// tooltip's arrow, which partially overlaps the content of the tooltip.
position: relative;
}
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
@use "../../variables" as var; @use "../../variables" as var;
.top-bar { .top-bar {
@include var.font-big;
color: var.$grey-mid; color: var.$grey-mid;
background: var.$white; background: var.$white;
border-bottom: solid 1px var.$grey-3; border-bottom: solid 1px var.$grey-3;
height: var.$top-bar-height; height: var.$top-bar-height;
// TODO bring into standard rhythm of typography
font-size: 15px;
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
...@@ -62,9 +61,9 @@ ...@@ -62,9 +61,9 @@
.top-bar__login-button { .top-bar__login-button {
@include buttons.button; @include buttons.button;
@include var.font-big;
padding: 0 0.25em; padding: 0 0.25em;
color: var.$color-brand; color: var.$color-brand;
font-size: var.$body2-font-size;
&:hover { &:hover {
color: var.$color-link-hover; color: var.$color-link-hover;
......
@use '../variables' as var with ( @use '../variables' as var;
$base-font-size: 12px,
$base-line-height: 20px
);
// Base styles // Base styles
// ----------- // -----------
...@@ -57,7 +54,6 @@ ...@@ -57,7 +54,6 @@
@use './components/thread-card'; @use './components/thread-card';
@use './components/thread-list'; @use './components/thread-list';
@use './components/toast-messages'; @use './components/toast-messages';
@use './components/tooltip';
@use './components/top-bar'; @use './components/top-bar';
@use './components/tutorial'; @use './components/tutorial';
@use './components/version-info'; @use './components/version-info';
...@@ -66,12 +62,11 @@ ...@@ -66,12 +62,11 @@
// ---------------- // ----------------
body { body {
@include var.font-normal;
height: 100%; height: 100%;
background-color: var.$color-background; background-color: var.$color-background;
color: var.$color-text; color: var.$color-text;
font-family: var.$sans-font-family; font-family: var.$sans-font-family;
font-size: var.$base-font-size;
font-weight: normal; font-weight: normal;
line-height: var.$base-line-height;
} }
...@@ -70,19 +70,17 @@ $sans-font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', ...@@ -70,19 +70,17 @@ $sans-font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande',
sans-serif !default; sans-serif !default;
$mono-font-family: Open Sans Mono, Menlo, DejaVu Sans Mono, monospace !default; $mono-font-family: Open Sans Mono, Menlo, DejaVu Sans Mono, monospace !default;
$base-font-size: 16px !default; // Transitional Typography (Temporary)
$base-line-height: 20px !default; // -----------------------------------
$body1-font-size: 12px; $annotator-base-font-size: 14px;
$body1-line-height: 1.4em; $annotator-base-line-height: 20px;
$body2-font-size: 14px; $annotator-adder-font-size: 12px;
$annotator-adder-line-height: 1em;
$normal-font-size: 13px; $annotator-bucket-bar-font-size: 10px;
$normal-line-height: 17px; $annotator-bucket-bar-line-height: 14px;
$small-font-size: 11px;
$small-line-height: 12px;
// Minimum font size for <input> fields on iOS. If the font size is smaller than // Minimum font size for <input> fields on iOS. If the font size is smaller than
// this, iOS will zoom into the field when focused. // this, iOS will zoom into the field when focused.
...@@ -108,14 +106,26 @@ $popup-menu-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); ...@@ -108,14 +106,26 @@ $popup-menu-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
// Mixins // Mixins
// ------ // ------
@mixin font-tiny {
font-size: 10px;
line-height: 14px;
font-weight: 400;
}
@mixin font-small { @mixin font-small {
font-size: $small-font-size; font-size: 11px;
line-height: $small-line-height; line-height: 15px;
font-weight: 400; font-weight: 400;
} }
@mixin font-normal { @mixin font-normal {
font-size: $normal-font-size; font-size: 13px;
line-height: $normal-line-height; line-height: 17px;
font-weight: 400; font-weight: 400;
} }
@mixin font-big {
font-size: 14px;
line-height: 20px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment