@financial-times/dotcom-ui-base-styles 7.2.7 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/LoadFontsEmbed.d.ts +3 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/lib/documentStyles.d.ts +2 -0
- package/dist/browser/lib/fontFaces.d.ts +1 -0
- package/dist/browser/lib/fontLoading.d.ts +2 -0
- package/dist/node/components/LoadFontsEmbed.d.ts +3 -0
- package/dist/node/index.d.ts +4 -0
- package/dist/node/lib/documentStyles.d.ts +2 -0
- package/dist/node/lib/fontFaces.d.ts +1 -0
- package/dist/node/lib/fontLoading.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +2021 -0
- package/package.json +8 -6
- package/src/components/LoadFontsEmbed.tsx +0 -8
- package/src/index.ts +0 -4
- package/src/lib/documentStyles.ts +0 -10
- package/src/lib/fontFaces.ts +0 -8
- package/src/lib/fontLoading.ts +0 -28
- package/styles.scss +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-base-styles",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "component.js",
|
|
6
6
|
"browser": "browser.js",
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
"styles": "styles.scss",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"tsc": "../../node_modules/.bin/tsc --incremental",
|
|
12
11
|
"clean": "npm run clean:dist && npm run clean:node_modules",
|
|
13
12
|
"clean:dist": "rm -rf dist",
|
|
14
13
|
"clean:node_modules": "rm -rf node_modules",
|
|
15
14
|
"clean:install": "npm run clean && npm i",
|
|
16
|
-
"build:
|
|
17
|
-
"build:
|
|
15
|
+
"build:browser": "tsc --module es2015 --outDir ./dist/browser",
|
|
16
|
+
"build:node": "tsc",
|
|
18
17
|
"build": "npm run build:node && npm run build:browser",
|
|
19
18
|
"dev": "echo -n node browser | parallel -u -d ' ' npm run build:{} -- --watch",
|
|
20
19
|
"preinstall": "[ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine"
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"license": "MIT",
|
|
25
24
|
"dependencies": {
|
|
26
25
|
"focus-visible": "^5.0.0",
|
|
27
|
-
"n-ui-foundations": "^
|
|
26
|
+
"n-ui-foundations": "^9.0.0"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
29
|
"check-engine": "^1.10.1",
|
|
@@ -39,6 +38,9 @@
|
|
|
39
38
|
"node": ">= 14.0.0",
|
|
40
39
|
"npm": "7.x || 8.x"
|
|
41
40
|
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist/"
|
|
43
|
+
],
|
|
42
44
|
"repository": {
|
|
43
45
|
"type": "git",
|
|
44
46
|
"repository": "https://github.com/Financial-Times/dotcom-page-kit.git",
|
|
@@ -48,4 +50,4 @@
|
|
|
48
50
|
"volta": {
|
|
49
51
|
"extends": "../../package.json"
|
|
50
52
|
}
|
|
51
|
-
}
|
|
53
|
+
}
|
package/src/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react'
|
|
2
|
-
|
|
3
|
-
export const documentStyles: CSSProperties = {
|
|
4
|
-
// Enable use of 100vw which does not account for the scroll bar
|
|
5
|
-
overflowX: 'hidden',
|
|
6
|
-
// o-colors "paper"
|
|
7
|
-
backgroundColor: '#fff1e5',
|
|
8
|
-
// o-colors "black-80"
|
|
9
|
-
color: '#33302e'
|
|
10
|
-
}
|
package/src/lib/fontFaces.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// NOTE: please also update dotcom-ui-base-styles/styles.scss $o-fonts-path when updating the URLs defined below. They
|
|
2
|
-
// need to stay in-sync to ensure our CSS output matches the resource hints we set.
|
|
3
|
-
export const fontFaceURLs = [
|
|
4
|
-
'https://www.ft.com/__origami/service/build/v3/font?font_format=woff2&font_name=MetricWeb-Regular&system_code=origami&version=1.12',
|
|
5
|
-
'https://www.ft.com/__origami/service/build/v3/font?font_format=woff2&font_name=MetricWeb-Semibold&system_code=origami&version=1.12',
|
|
6
|
-
'https://www.ft.com/__origami/service/build/v3/font?font_format=woff2&font_name=FinancierDisplayWeb-Regular&system_code=origami&version=1.12',
|
|
7
|
-
'https://www.ft.com/__origami/service/build/v3/font?font_format=woff2&font_name=FinancierDisplayWeb-Bold&system_code=origami&version=1.12'
|
|
8
|
-
]
|
package/src/lib/fontLoading.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// NOTE: Browser caches can be cleared independently of cookies so the
|
|
2
|
-
// presence of the cookie does not necessarily mean the file is still
|
|
3
|
-
// available in the browser's cache.
|
|
4
|
-
|
|
5
|
-
// NOTE: This function must be written as ES5 code because it will be stringified
|
|
6
|
-
// and embedded in the page to be executed in the browser. This also means all
|
|
7
|
-
// data and variables must be scoped within the function.
|
|
8
|
-
function loadCustomFonts() {
|
|
9
|
-
var rootElement = document.documentElement
|
|
10
|
-
|
|
11
|
-
if (/(^|\s)o-typography-fonts-loaded=1(;|$)/.test(document.cookie)) {
|
|
12
|
-
var fontLabels = ['sans', 'sans-bold', 'display', 'display-bold']
|
|
13
|
-
|
|
14
|
-
for (var i = 0; i < fontLabels.length; i++) {
|
|
15
|
-
rootElement.className = rootElement.className.replace('o-typography--loading-' + fontLabels[i], '')
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const loadCustomFontsJS = `(${loadCustomFonts.toString()}());`
|
|
21
|
-
|
|
22
|
-
// These class names should be added to the document element (<html>)
|
|
23
|
-
export const loadCustomFontsClassNames = [
|
|
24
|
-
'o-typography--loading-sans',
|
|
25
|
-
'o-typography--loading-sans-bold',
|
|
26
|
-
'o-typography--loading-display',
|
|
27
|
-
'o-typography--loading-display-bold'
|
|
28
|
-
].join(' ')
|
package/styles.scss
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
$system-code: 'page-kit-base-styles' !default;
|
|
2
|
-
|
|
3
|
-
// NOTE: please also update ./src/lib/fontFaces.ts when updating the URL below. They
|
|
4
|
-
// need to stay in-sync to ensure our CSS output matches the resource hints we set, so we don't load the fonts twice (once from resourceHint and once from o-fonts in n-ui-foundations)
|
|
5
|
-
// the $o-fonts-path value here is used to generate the @font-face url https://github.com/Financial-Times/origami/blob/main/components/o-fonts/src/scss/_mixins.scss#L148 that is imported through 'n-ui-foundations/main' styles.
|
|
6
|
-
// we depend on o-fonts's @font-face url instead of explicitly defining it here so we don't have to update page kit again when changing fonts
|
|
7
|
-
$o-fonts-path: 'https://www.ft.com/__origami/service/build/v3/font?version=1.12';
|
|
8
|
-
|
|
9
|
-
// TODO: Migrate into this package existing usage of n-ui-foundations that
|
|
10
|
-
// falls under definition of this package, with the intention of ideally
|
|
11
|
-
// being able to decommission n-ui-foundations.
|
|
12
|
-
@import 'n-ui-foundations/main';
|
|
13
|
-
|
|
14
|
-
.core .o--if-js,
|
|
15
|
-
.enhanced .o--if-no-js {
|
|
16
|
-
display: none !important;
|
|
17
|
-
}
|