Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and cleanup CSS variables and related helpers #239

Merged
merged 7 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/styles/background-shapes.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}

.bg-shape-swipe-top {
background: var(--color-orange) url('/images/swipe-top.svg') no-repeat bottom left;
background: var(--color-brand) url('/images/swipe-top.svg') no-repeat bottom left;
background-size: contain;
}

Expand Down
60 changes: 49 additions & 11 deletions addon/styles/colors.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,62 @@
.bg-orange {
background-color: var(--color-orange);
.bg-brand {
background-color: var(--color-brand);
color: var(--color-brand-text);

& h1,
& h2,
& h3,
& h4,
& h5,
& h6,
& .medium,
& .large,
& .xlarge {
color: var(--color-white);
}
}

.bg-muted {
background-color: var(--color-muted);
.bg-light {
background-color: var(--color-gray-100);
}

.bg-light-muted {
background-color: var(--color-gray-200);
}

.bg-dark {
background-color: var(--color-dark);
color: var(--color-light);
background-color: var(--color-gray-900);
color: var(--color-gray-300);

& h1,
& h2,
& h3,
& h4,
& h5,
& h6,
& .medium,
& .large,
& .xlarge,
& a {
color: var(--color-light);
color: var(--color-white);
}
}

.bg-muted {
background-color: var(--color-muted);
}

.bg-info {
background: var(--color-info);
}

.text-light {
color: var(--color-brand-text);

& h1,
& h2,
& h3,
& h4,
& h5,
& h6,
& .medium,
& .large,
& .xlarge {
color: var(--color-white);
}
}
4 changes: 2 additions & 2 deletions addon/styles/components/es-button.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.es-button {
background-color: var(--color-orange);
color: var(--color-light);
background-color: var(--color-brand);
color: var(--color-white);
padding-left: 1.5em;
padding-right: 1.5em;
padding-top: 1em;
Expand Down
8 changes: 4 additions & 4 deletions addon/styles/components/es-card.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.card {
border: 1px solid var(--color-gray);
border-radius: 4px;
border: 2px solid var(--color-gray-300);
border-radius: var(--radius-lg);
height: 100%;
overflow: hidden;
position: relative;
Expand All @@ -11,7 +11,7 @@
.card[card-link] h3 > a::after,
.card[card-link] h4 > a::after {
position: absolute;
top:0;
top: 0;
left: 0;
right: 0;
bottom: 0;
Expand All @@ -24,7 +24,7 @@

.card[card-link]:focus-within,
.card[card-link]:hover {
background-color: var(--color-muted);
background-color: var(--color-gray-200);
}

.card__image {
Expand Down
12 changes: 6 additions & 6 deletions addon/styles/components/es-footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.es-footer {
& a {
text-decoration: none;
color: var(--color-dark);
color: var(--color-gray-900);
}

& .footer-info {
Expand All @@ -25,7 +25,7 @@

& .footer-hr {
border: 0;
border-bottom: 2px solid var(--color-muted);
border-bottom: 2px solid var(--color-gray-200);
margin: 0;
}

Expand All @@ -36,24 +36,24 @@
}

& .footer-copyright {
color: var(--color-gray);
color: var(--color-gray-600);
}

& .footer-social {
display: flex;
align-items: center;

& svg {
fill: var(--color-gray);
fill: var(--color-gray-600);
}
}

& .footer-contributions-wrapper {
background-color: var(--color-muted);
background-color: var(--color-white);
}

& .footer-contributions {
color: var(--color-gray);
color: var(--color-gray-600);
padding: 0;
display: flex;
justify-content: space-between;
Expand Down
8 changes: 4 additions & 4 deletions addon/styles/components/es-header.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
justify-content: center;
align-items: center;
background-color: var(--color-dark);
background-color: var(--color-gray-900);
padding: 1rem var(--grid-margin);
}

Expand All @@ -12,8 +12,8 @@
}

.es-navbar {
background-color: var(--color-dark);
color: var(--color-light);
background-color: var(--color-gray-900);
color: var(--color-gray-100);
display: flex;
flex-direction: column;
font-size: 2rem;
Expand Down Expand Up @@ -139,7 +139,7 @@
}

.navbar-dropdown-list-item-link {
color: var(--color-orange);
color: var(--color-brand);
display: block;
padding: 1rem 2rem;
text-decoration: none;
Expand Down
12 changes: 0 additions & 12 deletions addon/styles/components/es-page-header.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
.es-page-header {
padding-top: 4.5rem;
padding-bottom: 4.5rem;
}

.es-page-header__title {
margin-top: 0;
margin-bottom: 0;
}

.es_page-header__details {
margin-top: 2em;
margin-bottom: 2em;
}
105 changes: 74 additions & 31 deletions addon/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,91 @@
--font-family-sans: 'Inter var', 'Inter web', -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
sans-serif, Apple Color Emoji, Segoe UI Emoji;

--color-dark: #1c1e23;
--color-light: #ffffff;
--color-muted: #f4f6f8;
--color-orange: #e04e39;
--color-white: #fff;
--color-gray-100: #f4f6f8;
--color-gray-200: #ebeef2;
--color-gray-300: #dce0e6;
--color-gray-400: #bec4cc;
--color-gray-500: #8f949f;
--color-gray-600: #6a707a;
--color-gray-700: #42474f;
--color-gray-800: #2b2d34;
--color-gray-900: #1c1e24;
--color-black: #000;

--color-brand: #e04e39;
--color-brand-text: #ffd7d2;
--color-brand-hc-light: #ff5c44;
--color-brand-hc-dark: #cf2d20;

--color-gray: #a2a3a8;
--color-success: #d9f9e3;
--color-danger: #ffd8e1;
--color-warning: #fcffc9;
--color-info: #e3eefc;

--font-size-1: 1.5rem;
--font-size-2: 1.875rem; /* 15dp, no need to use calc() for such a basic value */
--font-size-3: 2rem;
--font-size-4: 2.5rem;
--font-size-5: 4.5rem;
--font-size-display: 7.75rem;

--line-height-1: calc(16 / 12);
--line-height-2: 1.6;
--line-height-3: 1.5;
--line-height-4: 1.2;
--line-height-5: calc(48 / 36);
--line-height-display: calc(64 / 62);
--font-size-xs: 1.375rem; /* 11px */
--font-size-base: 1.625rem; /* p = 13px */
--font-size-md: 1.875rem; /* h3 = 15px */
--font-size-lg: 2.25rem; /* h2 = 18px */
--font-size-xl: 3.125rem; /* h1 = 25px */
--font-size-display-1: 4rem; /* display 1 = 32px */
--font-size-display-2: 1.875rem; /* display 2 = 15px */

--line-height-xs: calc(16 / 11);
--line-height-base: calc(24 / 13);
--line-height-md: 1.6;
--line-height-lg: calc(32 / 18);
--line-height-xl: 1.28;
--line-height-display-1: 1.25;
--line-height-display-2: 1.6;

--font-weight-1: 200;
--font-weight-2: 400;
--font-weight-3: 600;

--container-width: 119rem;
--grid-gap: 3rem;
--grid-gap-x: 3rem;
--grid-gap-y: 6rem;
--grid-margin: 1.5rem;

--spacing-1: 2rem;
--spacing-2: 3rem;
--spacing-3: 6rem;
--spacing-4: 9rem;
--spacing-5: 24rem;
--spacing-1: 1rem;
--spacing-2: 2rem;
--spacing-3: 3rem;
--spacing-4: 5rem;
--spacing-5: 8rem;

--radius: 0.625rem;
--radius-lg: 1.25rem;
}

/* 984px = 2rem + 119rem + 2rem */
@media (min-width: 984px) {
:root {
--grid-gap: 4rem;
--font-size-xs: 1.5rem; /* 12px */
--font-size-base: 1.875rem; /* 15px */
--font-size-md: 2rem; /* 16px */
--font-size-lg: 2.5rem; /* 20px */
--font-size-xl: 4.5rem; /* 36px */
--font-size-display-1: 7.75rem; /* 62px */
--font-size-display-2: 2.375rem; /* 19px */

--line-height-xs: calc(16 / 12);
--line-height-base: 1.6;
--line-height-md: 1.5;
--line-height-lg: 1.2;
--line-height-xl: calc(48 / 36);
--line-height-display-1: calc(64 / 62);
--line-height-display-2: calc(32 / 19);

--spacing-1: 2rem;
--spacing-2: 3rem;
--spacing-3: 6rem;
--spacing-4: 9rem;
--spacing-5: 24rem;

--grid-gap-x: 4rem;
--grid-gap-y: 9rem;
}
}

Expand All @@ -58,8 +100,8 @@ html {
margin: 0;
padding: 0;
font-family: var(--font-family-sans);
background: var(--color-light);
color: var(--color-dark);
background: var(--color-white);
color: var(--color-gray-700);
border: 0;
}

Expand All @@ -68,18 +110,18 @@ html {
}

body {
font-size: var(--font-size-2);
line-height: var(--line-height-2);
font-size: var(--font-size-base);
line-height: var(--line-height-base);
}

a {
color: var(--color-orange);
color: var(--color-brand);
text-decoration: none;
}

a:active,
.active {
color: var(--color-dark);
color: var(--color-gray-900);
}

p {
Expand All @@ -92,8 +134,9 @@ h3,
h4,
h5,
h6 {
font-weight: 500;
font-weight: var(--font-weight-2);
margin: 0 0 2rem 0;
color: var(--color-gray-900);
}

strong {
Expand Down
8 changes: 4 additions & 4 deletions addon/styles/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@
max-width: 100%;
}

.rounded-small {
border-radius: 0.75rem;
.rounded {
border-radius: var(--radius);
}

.rounded-large {
border-radius: 1.25rem;
.rounded-lg {
border-radius: var(--radius-lg);
}
2 changes: 1 addition & 1 deletion addon/styles/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.layout-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-gap: var(--grid-gap);
grid-gap: var(--grid-gap-y) var(--grid-gap-x);
}

.layout-grid > * {
Expand Down
Loading