-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDPA-3619] custom font support (#621)
* [SDPA-3619] Custom font support * Updated tests for better readability
- Loading branch information
Showing
34 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
examples/basic-examples/test/e2e/integration/custom/fonts.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: Custom font support | ||
|
||
As a developer I can use custom fonts other than the default Vic font | ||
|
||
Scenario: Custom fonts are used in theme | ||
Given I visit the page "/" | ||
Then the h1 heading should have the fonts "Oswald, Arial, Helvetica, sans-serif" |
9 changes: 9 additions & 0 deletions
9
examples/basic-examples/test/e2e/integration/custom/fonts/step_definition.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* global cy */ | ||
|
||
import { Then } from 'cypress-cucumber-preprocessor/steps' | ||
|
||
// This can only test css, can't test if the fonts got loaded. | ||
// I have tried to use 'https://github.com/bramstein/fontfaceobserver' but couldn't make it work here. | ||
Then('the h1 heading should have the fonts {string}', (font) => { | ||
cy.get('h1').should('have.css', 'font-family', font) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-26.7 KB
packages/components/Atoms/Global/assets/fonts/VIC-ExtraLightItalic.eot
Binary file not shown.
Binary file removed
BIN
-48.5 KB
packages/components/Atoms/Global/assets/fonts/VIC-ExtraLightItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-47.2 KB
packages/components/Atoms/Global/assets/fonts/VIC-SemiBoldItalic.ttf
Binary file not shown.
20 changes: 10 additions & 10 deletions
20
packages/components/Atoms/Global/scss/elements/_font.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
@each $font-label, $font-val in $rpl-fonts { | ||
$font: nth($font-val, 1); | ||
@font-face { | ||
// sass-lint:disable-block no-duplicate-properties | ||
font-family: $font; | ||
src: url('#{$rpl-font-directory}#{$font}.eot'); | ||
src: url('#{$rpl-font-directory}#{$font}.eot?#iefix') format('embedded-opentype'), | ||
url('#{$rpl-font-directory}#{$font}.woff') format('woff'), | ||
url('#{$rpl-font-directory}#{$font}.woff2') format('woff2'), | ||
url('#{$rpl-font-directory}#{$font}.ttf') format('truetype'); | ||
$rpl-fonts-default-loader: true !default; | ||
|
||
@if $rpl-fonts-default-loader { | ||
@each $font-label, $font-val in $rpl-fonts { | ||
$font: nth($font-val, 1); | ||
@font-face { | ||
font-family: $font; | ||
src: url('#{$rpl-font-directory}#{$font}.woff') format('woff'), | ||
url('#{$rpl-font-directory}#{$font}.woff2') format('woff2'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters