Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix fontWeight again#806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cknitt merged 1 commit intomainfromfix-font-weight-again
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
# Changelog of `rescript-react-native`

## Next

- BREAKING: Fix `fontWeight` type again. https://github.com/rescript-react-native/rescript-react-native/pull/806

## 0.72.0 - 2023-08-04

- Remove deprecated Slider, DatePickerIOS & ProgressViewIOS [82dc6e1](https://github.com/rescript-react-native/rescript-react-native/commit/82dc6e1) by [@MoOx](https://github.com/MoOx)
Expand Down
3 changes: 3 additions & 0 deletionssrc/apis/Style.bs.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,10 +13,13 @@ function rad(num) {
return num.toString() + "rad";
}

var FontWeight = {};

var empty = {};

exports.pct = pct;
exports.deg = deg;
exports.rad = rad;
exports.FontWeight = FontWeight;
exports.empty = empty;
/* No side effect */
31 changes: 30 additions & 1 deletionsrc/apis/Style.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,36 @@ type resizeMode = [#cover | #contain | #stretch | #repeat | #center]

type fontStyle = [#normal | #italic]

type fontWeight = [#normal | #bold | #100 | #200 | #300 | #400 | #500 | #600 | #700 | #800 | #900]
module FontWeight = {
// Note: we cannot model this as a polymorphic variant
// because #"100" = #100 = the number 100 in JS, but we need the string "100" here.
type t = string

@inline
let normal = "normal"
@inline
let bold = "bold"
@inline
let _100 = "100"
@inline
let _200 = "200"
@inline
let _300 = "300"
@inline
let _400 = "400"
@inline
let _500 = "500"
@inline
let _600 = "600"
@inline
let _700 = "700"
@inline
let _800 = "800"
@inline
let _900 = "900"
}

type fontWeight = FontWeight.t

// @todo in 0.71.0
// Apparently there are more `fontVariant` options IOS specific
Expand Down
30 changes: 29 additions & 1 deletionsrc/apis/Style.resi
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,8 +45,36 @@ type resizeMode = [#cover | #contain | #stretch | #repeat | #center]

type fontStyle = [#normal | #italic]

type fontWeight = [#normal | #bold | #100 | #200 | #300 | #400 | #500 | #600 | #700 | #800 | #900]
module FontWeight: {
// Note: we cannot model this as a polymorphic variant
// because #"100" = #100 = the number 100 in JS, but we need the string "100" here.
type t

@inline("normal")
let normal: t
@inline("bold")
let bold: t
@inline("100")
let _100: t
@inline("200")
let _200: t
@inline("300")
let _300: t
@inline("400")
let _400: t
@inline("500")
let _500: t
@inline("600")
let _600: t
@inline("700")
let _700: t
@inline("800")
let _800: t
@inline("900")
let _900: t
}

type fontWeight = FontWeight.t
type fontVariant = [
| #"small-caps"
| #"oldstyle-nums"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp