Skip to content

Commit b90560b

Browse files
sgnycknitt
authored andcommitted
Redefine FontVariants using [@bs.inline] (#372)
* Redefine FontVariants using [@bs.inline] * Move FontVariant out of Style, create interface file
1 parent 9ef70ba commit b90560b

4 files changed

Lines changed: 32 additions & 21 deletions

File tree

‎bs-react-native-next/src/apis/Style.bs.js‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,8 @@ var Transform = /* module */[
2525
/* rad */rad
2626
];
2727

28-
var FontVariant = /* module */[
29-
/* smallCaps */"small-caps",
30-
/* oldstyleNums */"oldstyle-nums",
31-
/* liningNums */"lining-nums",
32-
/* tabularNums */"tabular-nums",
33-
/* proportionalNums */"proportional-nums"
34-
];
35-
3628
exports.pct = pct;
3729
exports.Margin = Margin;
3830
exports.Size = Size;
3931
exports.Transform = Transform;
40-
exports.FontVariant = FontVariant;
4132
/* No side effect */

‎bs-react-native-next/src/apis/Style.re‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ module Transform = {
4545
[@bs.obj] external skewY: (~skewY: angle) => t = "";
4646
};
4747

48-
module FontVariant = {
49-
type t;
50-
51-
external fromString: string => t = "%identity";
52-
53-
let smallCaps = "small-caps"->fromString;
54-
let oldstyleNums = "oldstyle-nums"->fromString;
55-
let liningNums = "lining-nums"->fromString;
56-
let tabularNums = "tabular-nums"->fromString;
57-
let proportionalNums = "proportional-nums"->fromString;
58-
};
59-
6048
type offset;
6149
[@bs.obj] external offset: (~height: float, ~width: float) => offset = "";
6250

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type t = string;
2+
3+
[@bs.inline]
4+
let smallCaps = "small-caps";
5+
6+
[@bs.inline]
7+
let oldstyleNums = "oldstyle-nums";
8+
9+
[@bs.inline]
10+
let liningNums = "lining-nums";
11+
12+
[@bs.inline]
13+
let tabularNums = "tabular-nums";
14+
15+
[@bs.inline]
16+
let proportionalNums = "proportional-nums";
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type t;
2+
3+
[@bs.inline "small-caps"]
4+
let smallCaps: t;
5+
6+
[@bs.inline "oldstyle-nums"]
7+
let oldstyleNums: t;
8+
9+
[@bs.inline "lining-nums"]
10+
let liningNums: t;
11+
12+
[@bs.inline "tabular-nums"]
13+
let tabularNums: t;
14+
15+
[@bs.inline "proportional-nums"]
16+
let proportionalNums: t;

0 commit comments

Comments
 (0)