File: _fonts.scss

package info (click to toggle)
cockpit 356-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 317,176 kB
  • sloc: javascript: 775,374; python: 41,133; ansic: 33,875; cpp: 11,141; sh: 3,534; makefile: 581; xml: 262
file content (44 lines) | stat: -rw-r--r-- 2,288 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: LGPL-2.1-or-later */
// NOTE @Venefilyn: This is here for backwards compatibility. The file should be removed at some point.
// There are scenarios such as running tests for a plugin with a stable cockpit-shell/ws
// Since those may be older, for now we should include the old fonts to make sure that the plugins
// This allows plugins to still utilize the Red Hat fonts when testing plugins on or before Cockpit v336

@mixin printRedHatFont(
  $weightValue: 400,
  $weightName: "Regular",
  $familyName: "RedHatText",
  $style: "normal",
  $relative: true
) {
  $filePath: "../../static/fonts" + "/" + $familyName + "-" + $weightName;

  @font-face {
    font-family: $familyName;
    src: url("#{$filePath}.woff2") format("woff2");
    font-style: #{$style};
    font-weight: $weightValue;
    font-display: fallback;
  }
}

@include printRedHatFont(700, "Bold", $familyName: "RedHatDisplay");
@include printRedHatFont(700, "BoldItalic", $style: "italic", $familyName: "RedHatDisplay");
@include printRedHatFont(900, "Black", $familyName: "RedHatDisplay");
@include printRedHatFont(900, "BlackItalic", $style: "italic", $familyName: "RedHatDisplay");
@include printRedHatFont(300, "Italic", $style: "italic", $familyName: "RedHatDisplay");
@include printRedHatFont(400, "Medium", $familyName: "RedHatDisplay");
@include printRedHatFont(400, "MediumItalic", $style: "italic", $familyName: "RedHatDisplay");
@include printRedHatFont(300, "Regular", $familyName: "RedHatDisplay");
@include printRedHatFont(700, "Bold");
@include printRedHatFont(700, "BoldItalic", $style: "italic");
@include printRedHatFont(400, "Italic", $style: "italic");
@include printRedHatFont(700, "Medium");
@include printRedHatFont(700, "MediumItalic", $style: "italic");
@include printRedHatFont(400, "Regular");
@include printRedHatFont(700, "Bold", $familyName: "RedHatMono");
@include printRedHatFont(700, "BoldItalic", $style: "italic", $familyName: "RedHatMono");
@include printRedHatFont(400, "Italic", $style: "italic", $familyName: "RedHatMono");
@include printRedHatFont(500, "Medium", $familyName: "RedHatMono");
@include printRedHatFont(500, "MediumItalic", $style: "italic", $familyName: "RedHatMono");
@include printRedHatFont(400, "Regular", $familyName: "RedHatMono");