Skip to content

Commit

Permalink
Accept variable prop in google font loader (vercel#41065)
Browse files Browse the repository at this point in the history
Fixes local weight type which could break if you wrote "regular" instead of 400. Adds `variable` property to google font loader to let you define the name of the CSS variable.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
Hannes Bornö authored and Kikobeats committed Oct 24, 2022
1 parent 8e352b9 commit cfff36a
Show file tree
Hide file tree
Showing 15 changed files with 1,716 additions and 99 deletions.
134 changes: 129 additions & 5 deletions packages/font/src/google/font-data.json
Expand Up @@ -14,6 +14,9 @@
"Abril Fatface": {
"variants": ["400"]
},
"Abyssinica SIL": {
"variants": ["400"]
},
"Aclonica": {
"variants": ["400"]
},
Expand Down Expand Up @@ -193,6 +196,9 @@
"Alike Angular": {
"variants": ["400"]
},
"Alkalami": {
"variants": ["400"]
},
"Allan": {
"variants": ["400", "700"]
},
Expand Down Expand Up @@ -1656,6 +1662,7 @@
"700",
"800",
"900",
"1000",
"variable"
],
"axes": [
Expand All @@ -1677,6 +1684,7 @@
"700",
"800",
"900",
"1000",
"variable"
],
"axes": [
Expand Down Expand Up @@ -3473,6 +3481,7 @@
},
"Hepta Slab": {
"variants": [
"1",
"100",
"200",
"300",
Expand Down Expand Up @@ -3793,6 +3802,38 @@
}
]
},
"Inter Tight": {
"variants": [
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900",
"100-italic",
"200-italic",
"300-italic",
"400-italic",
"500-italic",
"600-italic",
"700-italic",
"800-italic",
"900-italic",
"variable",
"variable-italic"
],
"axes": [
{
"tag": "wght",
"min": 100,
"max": 900,
"defaultValue": 400
}
]
},
"Irish Grover": {
"variants": ["400"]
},
Expand Down Expand Up @@ -4349,7 +4390,7 @@
"variants": ["400"]
},
"Lateef": {
"variants": ["400"]
"variants": ["200", "300", "400", "500", "600", "700", "800"]
},
"Lato": {
"variants": [
Expand Down Expand Up @@ -5373,6 +5414,8 @@
"700",
"800",
"900",
"1000",
"100-italic",
"200-italic",
"300-italic",
"400-italic",
Expand Down Expand Up @@ -5637,7 +5680,15 @@
]
},
"Noto Nastaliq Urdu": {
"variants": ["400", "700"]
"variants": ["400", "500", "600", "700", "variable"],
"axes": [
{
"tag": "wght",
"min": 400,
"max": 700,
"defaultValue": 400
}
]
},
"Noto Rashi Hebrew": {
"variants": [
Expand Down Expand Up @@ -6000,6 +6051,34 @@
"Noto Sans Elymaic": {
"variants": ["400"]
},
"Noto Sans Ethiopic": {
"variants": [
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900",
"variable"
],
"axes": [
{
"tag": "wdth",
"min": 62.5,
"max": 100,
"defaultValue": 100
},
{
"tag": "wght",
"min": 100,
"max": 900,
"defaultValue": 400
}
]
},
"Noto Sans Georgian": {
"variants": [
"100",
Expand Down Expand Up @@ -6160,7 +6239,15 @@
"variants": ["100", "300", "400", "500", "700", "900"]
},
"Noto Sans Javanese": {
"variants": ["400", "700"]
"variants": ["400", "500", "600", "700", "variable"],
"axes": [
{
"tag": "wght",
"min": 400,
"max": 700,
"defaultValue": 400
}
]
},
"Noto Sans KR": {
"variants": ["100", "300", "400", "500", "700", "900"]
Expand Down Expand Up @@ -6486,7 +6573,32 @@
"variants": ["400"]
},
"Noto Sans Oriya": {
"variants": ["100", "400", "700", "900"]
"variants": [
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900",
"variable"
],
"axes": [
{
"tag": "wdth",
"min": 62.5,
"max": 100,
"defaultValue": 100
},
{
"tag": "wght",
"min": 100,
"max": 900,
"defaultValue": 400
}
]
},
"Noto Sans Osage": {
"variants": ["400"]
Expand Down Expand Up @@ -7392,6 +7504,8 @@
"700",
"800",
"900",
"1000",
"100-italic",
"200-italic",
"300-italic",
"400-italic",
Expand Down Expand Up @@ -8203,7 +8317,17 @@
]
},
"Recursive": {
"variants": ["300", "400", "500", "600", "700", "800", "900", "variable"],
"variants": [
"300",
"400",
"500",
"600",
"700",
"800",
"900",
"1000",
"variable"
],
"axes": [
{
"tag": "CASL",
Expand Down

0 comments on commit cfff36a

Please sign in to comment.