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

Font sizes #39

Merged
merged 2 commits into from
Dec 6, 2023
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
98 changes: 0 additions & 98 deletions css/font-sizes.css
Original file line number Diff line number Diff line change
@@ -1,101 +1,3 @@
/**
* Font Sizes
*/
:root {
--bb-size-0: 0;
--bb-size-1: 1px;
--bb-size-2: 2px;
--bb-size-4: 4px;
--bb-size-6: 6px;
--bb-size-8: 8px;
--bb-size-12: 12px;
--bb-size-16: 16px;
--bb-size-24: 24px;
--bb-size-32: 32px;
--bb-size-48: 48px;
--bb-size-64: 64px;
--bb-size-96: 96px;
--bb-size-128: 128px;
}

.fs0 {
font-size: var(--bb-size-0);
}

.fs1 {
font-size: var(--bb-size-1);
}

.fs2 {
font-size: var(--bb-size-2);
}

.fs4 {
font-size: var(--bb-size-4);
}

.fs6 {
font-size: var(--bb-size-6);
}

.fs8 {
font-size: var(--bb-size-8);
}

.fs12 {
font-size: var(--bb-size-12);
}

.fs16 {
font-size: var(--bb-size-16);
}

.fs24 {
font-size: var(--bb-size-24);
}

.fs32 {
font-size: var(--bb-size-32);
}

.fs48 {
font-size: var(--bb-size-48);
}

.fs64 {
font-size: var(--bb-size-64);
}

.fs96 {
font-size: var(--bb-size-96);
}

.fs128 {
font-size: var(--bb-size-128);
}

/* Breakpoint md */
@media only screen and (max-width: 1024px) {
:root {
--bb-size-32: 30px;
--bb-size-48: 40px;
--bb-size-64: 50px;
--bb-size-96: 60px;
--bb-size-128: 70px;
}
}
/* Breakpoint xs */
@media only screen and (max-width: 480px) {
:root {
--bb-size-128: 60px;
}
}
:root {
--bb-size-h1: 60px;
--bb-size-h2: 50px;
--bb-size-h3: 40px;
--bb-size-h4: 30px;
--bb-size-h5: 20px;
--bb-size-h6: var(--bb-size-16);
--bb-size-body: var(--bb-size-16);
}
3 changes: 2 additions & 1 deletion scss/_build.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
@import "cursors";
@import "aspect-ratio";
@import "extra";
@import "container";
@import "container";
@import "font-sizes";
41 changes: 23 additions & 18 deletions scss/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ $breakpoints: (
// "gap-container":40px, // Add unit to not use the responsive value
//);

// font sizes
//$font_sizes: (
// "values": 13 14 15 16 18 20 28 30 32 35 40 50 70 100,
// "md": 13 14 15 16 18 20 24 26 28 32 35 40 50 71,
// "sm": 13 14 15 16 18 20 22 24 26 30 32 36 40 58,
// "xs": 13 14 15 16 16 18 20 24 24 26 30 33 34 48
//);


// font size custom name
// The value must be defined by font_sizes above
//$font_size_custom: (
// "h1": 40,
// "h2": 35,
// "h3": 35,
// "h4": 18,
// "h5": 16,
// "h6": 15,
// 'body': 16,
// "large": 100,
//);


// containers
//$containers: (
// "container-small": 768,
Expand All @@ -83,21 +106,3 @@ $breakpoints: (
// "isWoocommerce": false // true if project using woocommerce
//);

// font sizes
$font_sizes: (
"values":0 1 2 4 6 8 12 16 24 32 48 64 96 128,
"md": 0 1 2 4 6 8 12 16 24 30 40 50 60 70,
"xs": 0 1 2 4 6 8 12 16 24 30 40 50 60 60,
);

// font size custom name
// The value must be defined by font_sizes above
$font_size_custom: (
"h1": 60,
"h2": 50,
"h3": 40,
"h4": 30,
"h5": 20,
"h6": 16,
'body': 16
);
6 changes: 6 additions & 0 deletions scss/_defs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ $coordinate_values: (
// aspect ratio
$aspect_ratio: ();

// font sizes
$font_sizes: ();

// font size custom name
$font_size_custom: ();

// containers
$containers: ();
//$containers: (
Expand Down
10 changes: 5 additions & 5 deletions scss/font-sizes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// and changed compare with the previous value
@if $value != $previous_postfix {
@include get-variable(bb-size-#{replace-prop($postfix)}, #{format-value($value)});
@include get-variable(size-#{replace-prop($postfix)}, #{format-value($value)});
}
}
}
Expand All @@ -36,7 +36,7 @@
$postfix: get-previous-breakpoint-value($i, $value, $breakpoint, $font_sizes);
//@debug $value, $postfix;

@include get-variable(bb-size-#{replace-prop($postfix)}, #{format-value($value)});
@include get-variable(size-#{replace-prop($postfix)}, #{format-value($value)});
}
}

Expand All @@ -46,7 +46,7 @@
$postfix: get-previous-breakpoint-value($i, $value, $breakpoint, $font_sizes);
//@debug $value, $postfix;

$var: var(#{get-variable(bb-size-#{replace-prop($postfix)})});
$var: var(#{get-variable(size-#{replace-prop($postfix)})});

.fs#{replace-prop($postfix)} {
font-size: #{$var};
Expand All @@ -67,9 +67,9 @@
$isValid: map-search($list, $value);
// if the value is not existing in the $font_sizes, create 'px' for the value
@if (not $isValid) {
@include get-variable(bb-size-#{replace-prop($name)}, format-value($value));
@include get-variable(size-#{replace-prop($name)}, format-value($value));
} @else {
@include get-variable(bb-size-#{replace-prop($name)}, var(#{get-variable(bb-size-#{replace-prop($value)})}));
@include get-variable(size-#{replace-prop($name)}, var(#{get-variable(size-#{replace-prop($value)})}));
}
}
}
Expand Down