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

[WIP]: add layout changes #20

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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 src/_includes/modules/featured/course.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- if module.heading -%}
<h2>{{ module.heading }}</h2>
{%- endif -%}
<ul>
<ul class="grid-col-3 unstyled-list">
{%- for item in module.items -%}
{%- set id = item | upper -%}
<li>
Expand Down
17 changes: 2 additions & 15 deletions src/pages/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ meta:
bodyClass: home
---
{%- set hero = heros[featured['home']['hero']] -%}
{%- set heroClass = "home-hero bg-mono-800 full-bleed" -%}
{%- set heroClass = "home-hero bg-mono-800 full-bleed grid-col-1-2" -%}
{%- include 'modules/hero.njk' -%}

<section class="how-gymnasium-works">
<h1>How Gymnasium Works</h1>
<ul>
<ul class="grid-col-4 unstyled-list">
<li>
<h2>Free Online Courses</h2>
<p>Our courses are taught by industry experts. You can enroll anytime,
Expand Down Expand Up @@ -49,16 +49,3 @@ meta:
</header>
{%- include 'modules/jobs.njk' -%}
</section>

<section class="as-seen-in">
<header>
<h1>As Seen In</h1>
</header>
<ul>
{%- for i in range(1,6) -%}
<li>
<img src="https://placehold.co/200x50?text=logo {{ i }}" alt="Logo">
</li>
{%- endfor -%}
</ul>
</section>
1 change: 1 addition & 0 deletions src/scss/base/_backgrounds.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}

// TODO: determine if this is the best way to handle a 'full bleed' approach
// TODO: this full bleed breaks on small screens (see the home hero for an example
&.full-bleed {
box-shadow: -30rem 0 var(--#{$color}-#{$shade}), 30rem 0 var(--#{$color}-#{$shade}), -70rem 0 var(--#{$color}-#{$shade}), 70rem 0 var(--#{$color}-#{$shade}), -140rem 0 var(--#{$color}-#{$shade}), 140rem 0 var(--#{$color}-#{$shade});
}
Expand Down
1 change: 1 addition & 0 deletions src/scss/base/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $colors: (
secondary: (
100: hsl(19, 100%, 54%), // #ff5f14
),
// TODO: consider remapping this from dark (100) to light (900)
mono: (
100: hsl(0 0% 100%), // white
200: hsl(0 0% 92%), // #ebebeb
Expand Down
44 changes: 40 additions & 4 deletions src/scss/base/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,46 @@
// | -------------------------------------------------------------

@use 'breakpoints' as *;
@use 'variables' as *;

// TODO: consider better naming conventions
.layout-1fr-2fr {
// Any class containing `grid-` will automatically display as a grid
[class*="grid-"] {
display: grid;
grid-template-columns: 1fr 2fr;
grid-gap: 2.6em;
gap: $grid-gap;
}

// Used in hero, course about MFE, courses index
.grid-col-1-2 {
@media (min-width: 75em) {
grid-template-columns: 1fr 2fr;
}
}

// TODO: consider improved stacking/breakpoints, etc
.grid-col-3 {
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));


// TODO: Check breakpoints for consistency
@media (min-width: 38em) and (max-width: 57em) {
:first-child {
grid-column: span 2; // TODO: check `span all` support
}
}
}

// TODO: refine as necessary
.grid-col-4 {
// see home page text for the implementation
gap: $grid-gap;

@media (min-width: 38em) {
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

@media (min-width: 58em) {
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
}


9 changes: 9 additions & 0 deletions src/scss/base/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@use 'breakpoints' as *;

// TODO: revisit these contraptions, as Justin described them...
nav ul {
list-style: none linear-gradient(transparent, transparent); // Fallback
list-style: ""; // Re-add list semantics
Expand Down Expand Up @@ -75,3 +76,11 @@ ol.incremented {
}
}
}

// TODO: if we rename, be sure to search/replace everywhere (static, MFE, theme)
.unstyled-list {
list-style: none linear-gradient(transparent, transparent); // Fallback
list-style: ""; // Re-add list semantics
margin: 0;
padding-left: 0;
}
4 changes: 4 additions & 0 deletions src/scss/base/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// TODO: populate this with reusable tokens for our sanity
// See @https://carbondesignsystem.com/elements/spacing/overview/ for inspiration
$global-spacing: 2rem;
$grid-gap: $global-spacing;
44 changes: 0 additions & 44 deletions src/scss/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
margin-top: 0;
}

// hero styling (full compiled class name is`.home-hero`)
&-hero {
display: grid;
grid-template-columns: 1fr 2fr;
grid-gap: 2.6em;
}

// top/bottom padding for each component of the home page
article,
section {
Expand All @@ -28,40 +21,3 @@
}
}
}



.how-gymnasium-works {

ul {
list-style: none;
margin: 0;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-gap: 2.6em;
}
}

.home-featured-courses {
ul {
list-style: none;
margin: 0;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 2.6em;
}
}

.home-find-work {

}

.as-seen-in {
ul {
list-style: none;
margin: 0;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
grid-gap: 2.6em;
}
}