Skip to content

Commit

Permalink
✨ feat(font.scss): Add new font style classes #192
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderpig86 committed Aug 27, 2023
1 parent 3487092 commit cb7639b
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 18 deletions.
11 changes: 10 additions & 1 deletion dist/cirrus-all.css
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ mark,
font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.font-alt, .font-secondary {
.font-alt,
.font-secondary {
font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

Expand Down Expand Up @@ -710,6 +711,14 @@ mark,
text-transform: none;
}

.font-style-normal {
font-style: normal;
}

.font-style-italics {
font-style: italics;
}

.rtl {
direction: rtl;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus-all.min.css

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion dist/cirrus-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ mark,
font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.font-alt, .font-secondary {
.font-alt,
.font-secondary {
font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

Expand Down Expand Up @@ -709,6 +710,14 @@ mark,
text-transform: none;
}

.font-style-normal {
font-style: normal;
}

.font-style-italics {
font-style: italics;
}

.rtl {
direction: rtl;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus-core.min.css

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion dist/cirrus.css
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ mark,
font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.font-alt, .font-secondary {
.font-alt,
.font-secondary {
font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

Expand Down Expand Up @@ -710,6 +711,14 @@ mark,
text-transform: none;
}

.font-style-normal {
font-style: normal;
}

.font-style-italics {
font-style: italics;
}

.rtl {
direction: rtl;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus.min.css

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/base/font.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ mark,
font-family: map-get($map: $font-families, $key: primary);
}

.font-alt, .font-secondary {
.font-alt,
.font-secondary {
font-family: map-get($map: $font-families, $key: secondary);
}

Expand Down Expand Up @@ -123,19 +124,18 @@ mark,
}
}

@include utility(
$prefix: '',
$class-value-pairs: class-value-map-with-single-property('font-style', $font-styles),
$common-class-name: 'font-style',
$variants: (),
$generate-viewports: false
);

.rtl {
direction: rtl;
}

// .white { Deprecated 0.6.5, use text-white instead
// color: #fff !important;
// }

// Deprecated 0.6.5, use u-opacity-x
// .faded {
// opacity: 0.75;
// }

/* Font Awesome */
.icon {
/* Usually used in spans */
Expand Down
5 changes: 5 additions & 0 deletions src/internal/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ $default-config: (
'Segoe UI Symbol',
),
),
font-styles: (
normal: normal,
italics: italics
),
letter-spacing: (
tightest: -0.075em,
tighter: -0.05em,
Expand Down Expand Up @@ -868,6 +872,7 @@ $font-heading-sizes: functions.get-with-extend($all-config, fonts, sizes, headin
$font-headline-sizes: functions.get-with-extend($all-config, fonts, sizes, headline);
$font-text-sizes: functions.get-with-extend($all-config, fonts, sizes, text);
$font-families: functions.get-with-extend($all-config, fonts, font-families);
$font-styles: functions.get-with-extend($all-config, fonts, font-styles);
$font-letter-spacing: functions.get-with-extend($all-config, fonts, letter-spacing);
$font-line-heights: functions.get-with-extend($all-config, fonts, line-heights);
$font-transforms: functions.get-with-extend($all-config, fonts, transforms);
Expand Down
6 changes: 4 additions & 2 deletions src/internal/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@
border-color: api.fill('success');

&:focus {
box-shadow: 0 0 0 0.2rem transparentize(api.fill('success'), 1 - theme.$focus-opacity), inset 0px 1px 8px rgba(0, 0, 0, 0.07);
box-shadow: 0 0 0 0.2rem transparentize(api.fill('success'), 1 - theme.$focus-opacity),
inset 0px 1px 8px rgba(0, 0, 0, 0.07);
}
}

@mixin input-error {
border-color: api.fill('danger');

&:focus {
box-shadow: 0 0 0 0.2rem transparentize(api.fill('danger'), 1 - theme.$focus-opacity), inset 0px 1px 8px rgba(0, 0, 0, 0.07);
box-shadow: 0 0 0 0.2rem transparentize(api.fill('danger'), 1 - theme.$focus-opacity),
inset 0px 1px 8px rgba(0, 0, 0, 0.07);
}
}

Expand Down

0 comments on commit cb7639b

Please sign in to comment.