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

fix: Adds hero styling options and fixes #673

Merged
merged 5 commits into from
Oct 23, 2024
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
10 changes: 10 additions & 0 deletions manon/hero-content-container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*----------------------------------------------------------------------------------*/
/*------------------------- hero-content-container.scss ----------------------------*/
/*----------------------------------------------------------------------------------*/
@use "mixins/hero";

.hero {
.content-container {
@include hero.hero-content-container;
}
}
10 changes: 10 additions & 0 deletions manon/hero-div.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*----------------------------------------------------------------------------------*/
/*--------------------------------- hero-div.scss ----------------------------------*/
/*----------------------------------------------------------------------------------*/
@use "mixins/hero";

.hero {
> div {
@include hero.hero-content-container;
}
}
8 changes: 7 additions & 1 deletion manon/hero-variables.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
/*----------------------------------------------------------------------------------*/
/*-------------------------------- hero-variables.scss -----------------------------*/
/*----------------------------------------------------------------------------------*/
@use "mixins/tile";
@use "mixins/list";

:root {
--hero-min-height: 30rem;
--hero-height: auto;
/* --hero-max-height: ; */

/* Title */
--hero-title-font-size: 2rem;
--hero-title-text-color: var(--application-base-text-color);

/* Image */
--hero-image-object-position: center;

@include tile.tile-variables("hero-tile-", "tile-");
@include list.list-variables("hero-tile-list-", "hero-list-");
@include list.list-variables("hero-list-", "list-base-");
}
3 changes: 2 additions & 1 deletion manon/hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
max-height: var(--hero-max-height);
position: relative;
padding: 0;
background-color: var(--hero-background-color);

img {
object-fit: cover;
Expand All @@ -21,7 +22,7 @@
height: 100%;
position: absolute;
top: 0;
z-index: -1;
z-index: 0;
}

h1,
Expand Down
32 changes: 2 additions & 30 deletions manon/list-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,11 @@
/*------------------- components/list-base.scss -----------------*/
/*---------------------------------------------------------------*/
@use "list-base-variables";
@use "mixins/list";

ul,
ol {
display: flex;
flex-direction: column;
gap: var(--list-base-gap);
padding: var(--list-base-padding);
background-color: var(--list-base-background-color);
line-height: var(--list-base-line-height);
font-size: var(--list-base-font-size);
font-weight: var(--list-base-font-weight);
color: var(--list-base-text-color);
margin: 0;
box-sizing: border-box;

li {
background-color: var(--list-base-item-background-color);
border-width: var(--list-base-item-border-width);
border-style: var(--list-base-item-border-style);
border-color: var(--list-base-item-border-color);
padding: var(--list-base-item-padding);
line-height: var(--list-base-item-line-height);
font-size: var(--list-base-item-font-size);
font-weight: var(--list-base-item-font-weight);
color: var(--list-base-item-text-color);
box-sizing: border-box;

a {
line-height: inherit;
font-size: inherit;
font-weight: inherit;
}
}
@include list.list("list-base-");
}

/*
Expand Down
37 changes: 37 additions & 0 deletions manon/mixins/hero.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*---------------------------------------------------------------------*/
/*------------------------- mixins/hero.scss --------------------------*/
/*---------------------------------------------------------------------*/
@use "tile";
@use "list";

@mixin hero-content-container {
& {
display: flex;
flex-direction: var(--hero-content-container-flex-direction);
justify-content: var(--hero-content-container-justify-content);
align-items: var(--hero-content-container-align-items);
width: 100%;
height: 100%;
box-sizing: border-box;
padding-top: var(--hero-content-container-padding-top);
padding-right: var(--hero-content-container-padding-right);
padding-bottom: var(--hero-content-container-padding-bottom);
padding-left: var(--hero-content-container-padding-left);
z-index: 1;
color: var(--hero-content-container-text-color);

.tile {
@include tile.tile("hero-tile-");

ul,
ol {
@include list.list("hero-tile-list-");
}
}

ul,
ol {
@include list.list("hero-list-");
}
}
}
60 changes: 60 additions & 0 deletions manon/mixins/list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*---------------------------------------------------------------------*/
/*------------------------------ list.scss ----------------------------*/
/*---------------------------------------------------------------------*/
@mixin list($prefix) {
& {
display: flex;
flex-direction: column;
gap: var(--#{$prefix}gap);
padding: var(--#{$prefix}padding);
background-color: var(--#{$prefix}background-color);
line-height: var(--#{$prefix}line-height);
font-size: var(--#{$prefix}font-size);
font-weight: var(--#{$prefix}font-weight);
color: var(--#{$prefix}text-color);
margin: 0;
box-sizing: border-box;

li {
background-color: var(--#{$prefix}item-background-color);
border-width: var(--#{$prefix}item-border-width);
border-style: var(--#{$prefix}item-border-style);
border-color: var(--#{$prefix}item-border-color);
padding: var(--#{$prefix}item-padding);
line-height: var(--#{$prefix}item-line-height);
font-size: var(--#{$prefix}item-font-size);
font-weight: var(--#{$prefix}item-font-weight);
color: var(--#{$prefix}item-text-color);
box-sizing: border-box;

a {
line-height: inherit;
font-size: inherit;
font-weight: inherit;
}
}
}
}

@mixin list-variables($prefix, $parentPrefix) {
/* List */
--#{$prefix}gap: var(--#{$parentPrefix}gap);
--#{$prefix}padding: var(--#{$parentPrefix}padding);
--#{$prefix}background-color: var(--#{$parentPrefix}background-color);
--#{$prefix}line-height: var(--#{$parentPrefix}line-height);
--#{$prefix}font-size: var(--#{$parentPrefix}font-size);
--#{$prefix}font-weight: var(--#{$parentPrefix}font-weight);
--#{$prefix}text-color: var(--#{$parentPrefix}flex-text-color);

/* List item */
--#{$prefix}item-background-color: var(
--#{$parentPrefix}item-background-color
);
--#{$prefix}item-border-width: var(--#{$parentPrefix}item-border-width);
--#{$prefix}item-border-style: var(--#{$parentPrefix}item-border-style);
--#{$prefix}item-border-color: var(--#{$parentPrefix}item-border-color);
--#{$prefix}item-padding: var(--#{$parentPrefix}item-padding);
--#{$prefix}item-line-height: var(--#{$parentPrefix}item-line-height);
--#{$prefix}item-font-size: var(--#{$parentPrefix}item-font-size);
--#{$prefix}item-text-color: var(--#{$parentPrefix}item-text-color);
}
59 changes: 59 additions & 0 deletions manon/mixins/tile.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------*/
/*------------------------------ tile.scss ----------------------------*/
/*---------------------------------------------------------------------*/
@mixin tile($prefix) {
& {
display: flex;
flex-direction: var(--#{$prefix}flex-direction, column);
gap: var(--#{$prefix}gap);
border-width: var(--#{$prefix}border-width);
border-style: var(--#{$prefix}border-style);
border-color: var(--#{$prefix}border-color);
border-radius: var(--#{$prefix}border-radius);
box-sizing: border-box;
background-color: var(--#{$prefix}background-color);
color: var(--#{$prefix}text-color);
padding-top: var(--#{$prefix}padding-top);
padding-right: var(--#{$prefix}padding-right);
padding-bottom: var(--#{$prefix}padding-bottom);
padding-left: var(--#{$prefix}padding-left);

> * {
box-sizing: border-box;
width: 100%;
}

h1 {
font-size: var(--tile-title-font-size-text);
color: var(--tile-title-text-color, inherit);
}

h2 {
font-size: var(--tile-subtitle-font-size-text);
color: var(--tile-subtitle-text-color, inherit);
}

ul {
padding-left: 2rem;
}

button {
width: auto;
}
}
}

@mixin tile-variables($prefix, $parentPrefix) {
--#{$prefix}flex-direction: var(--#{$parentPrefix}flex-direction);
--#{$prefix}gap: var(--#{$parentPrefix}gap);
--#{$prefix}border-width: var(--#{$parentPrefix}border-width);
--#{$prefix}border-style: var(--#{$parentPrefix}border-style);
--#{$prefix}border-color: var(--#{$parentPrefix}border-color);
--#{$prefix}border-radius: var(--#{$parentPrefix}border-radius);
--#{$prefix}background-color: var(--#{$parentPrefix}background-color);
--#{$prefix}text-color: var(--#{$parentPrefix}text-color);
--#{$prefix}padding-top: var(--#{$parentPrefix}padding-top);
--#{$prefix}padding-right: var(--#{$parentPrefix}padding-right);
--#{$prefix}padding-bottom: var(--#{$parentPrefix}padding-bottom);
--#{$prefix}padding-left: var(--#{$parentPrefix}padding-left);
}
41 changes: 4 additions & 37 deletions manon/tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,10 @@
/*-------------------------- tile.scss --------------------------*/
/*---------------------------------------------------------------*/
@use "tile-variables";
@use "mixins/tile";

%tile,
.tile {
display: flex;
flex-direction: var(--tile-flex-direction, column);
gap: var(--tile-gap);
border-width: var(--tile-border-width);
border-style: var(--tile-border-style);
border-color: var(--tile-border-color);
box-sizing: border-box;
background-color: var(--tile-background-color);
color: var(--tile-text-color);
padding-top: var(--tile-padding-top);
padding-right: var(--tile-padding-right);
padding-bottom: var(--tile-padding-bottom);
padding-left: var(--tile-padding-left);
border-radius: var(--tile-border-radius);

> * {
box-sizing: border-box;
width: 100%;
color: inherit;
}

h1 {
font-size: var(--tile-title-font-size-text);
color: var(--tile-title-text-color, inherit);
}

h2 {
font-size: var(--tile-subtitle-font-size-text);
color: var(--tile-subtitle-text-color, inherit);
}

ul {
padding-left: 2rem;
}
@include tile.tile("tile-");
}

.tiles {
Expand All @@ -48,15 +15,15 @@
> div,
> nav,
> section {
@extend %tile;
@include tile.tile("tile-");
}
}

ul.tiles {
padding-left: 0;

> li {
@extend %tile;
@include tile.tile("tile-");

> a {
color: var(--text-dark);
Expand Down