git.iko.soy/rowtype-yoga/psfp
on master help sign in
Font-fiddling
commitf86fac1dcaa17fcf919955189846e54659aa5f82 authorMark Eibes <mark.eibes@gmail.com> dateWed 6 Jan 2021, 09:43 (6 years ago) parent60ca4cd
6 files changed+208−198
blog/package-lock.json+22 blog/package.json+2 blog/src/components/MDXProvider.purs+83−99 blog/src/components/PSLayout.purs+90−91 blog/src/components/fonts.js+7−4 blog/src/purescript/Typography/SmallCaps.purs+4−4
blog/package-lock.json+22
@@ -11,7 +11,9 @@
1111 "dependencies": {
1212 "@emotion/core": "^10.0.28",
1313 "@fontsource/cormorant-garamond": "^4.1.0",
14+ "@fontsource/cormorant-sc": "^4.1.0",
1415 "@fontsource/inter": "^4.1.0",
16+ "@fontsource/pt-serif": "^4.1.0",
1517 "@material-ui/styles": "^4.9.0",
1618 "@mdx-js/mdx": "^1.1.5",
1719 "@mdx-js/react": "^1.1.5",
@@ -1729,11 +1731,21 @@
17291731 "resolved": "https://registry.npmjs.org/@fontsource/cormorant-garamond/-/cormorant-garamond-4.1.0.tgz",
17301732 "integrity": "sha512-Q9q+uj3ZmBrqn3knh5pVAB6kVXPDfut74U5lGxhf3gHQihrckOv/0Cw3ObKMc69r6OBk+IRcQN7A5d1aVVBGhw=="
17311733 },
1734+ "node_modules/@fontsource/cormorant-sc": {
1735+ "version": "4.1.0",
1736+ "resolved": "https://registry.npmjs.org/@fontsource/cormorant-sc/-/cormorant-sc-4.1.0.tgz",
1737+ "integrity": "sha512-cyXp0MZCr/vU+WF6Og5H8/Xn0rKuiMZ0DlbSjChm6HJJHbok3vuZwOAtzEn9rCV2aAxqBk6ARIl1l0aWcfSAoQ=="
1738+ },
17321739 "node_modules/@fontsource/inter": {
17331740 "version": "4.1.0",
17341741 "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-4.1.0.tgz",
17351742 "integrity": "sha512-v1JHGLAejSV0ec6fVR31vrojpM+JUiNVn0xJxL/ngmbyClDEf8qna5NFsu/xef67KT2kQ2YaU+wCuQEQHG55sw=="
17361743 },
1744+ "node_modules/@fontsource/pt-serif": {
1745+ "version": "4.1.0",
1746+ "resolved": "https://registry.npmjs.org/@fontsource/pt-serif/-/pt-serif-4.1.0.tgz",
1747+ "integrity": "sha512-N2EpV4J0wgrwrNsEUG0wz3uX/wD44Yd3Tnm2vujbFHOCIBSSTAjiOImpl65ac7M7jRXxFnEpHjfofeDKSgvnFg=="
1748+ },
17371749 "node_modules/@graphql-tools/batch-execute": {
17381750 "version": "7.0.0",
17391751 "resolved": "https://registry.npmjs.org/@graphql-tools/batch-execute/-/batch-execute-7.0.0.tgz",
@@ -35244,11 +35256,21 @@
3524435256 "resolved": "https://registry.npmjs.org/@fontsource/cormorant-garamond/-/cormorant-garamond-4.1.0.tgz",
3524535257 "integrity": "sha512-Q9q+uj3ZmBrqn3knh5pVAB6kVXPDfut74U5lGxhf3gHQihrckOv/0Cw3ObKMc69r6OBk+IRcQN7A5d1aVVBGhw=="
3524635258 },
35259+ "@fontsource/cormorant-sc": {
35260+ "version": "4.1.0",
35261+ "resolved": "https://registry.npmjs.org/@fontsource/cormorant-sc/-/cormorant-sc-4.1.0.tgz",
35262+ "integrity": "sha512-cyXp0MZCr/vU+WF6Og5H8/Xn0rKuiMZ0DlbSjChm6HJJHbok3vuZwOAtzEn9rCV2aAxqBk6ARIl1l0aWcfSAoQ=="
35263+ },
3524735264 "@fontsource/inter": {
3524835265 "version": "4.1.0",
3524935266 "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-4.1.0.tgz",
3525035267 "integrity": "sha512-v1JHGLAejSV0ec6fVR31vrojpM+JUiNVn0xJxL/ngmbyClDEf8qna5NFsu/xef67KT2kQ2YaU+wCuQEQHG55sw=="
3525135268 },
35269+ "@fontsource/pt-serif": {
35270+ "version": "4.1.0",
35271+ "resolved": "https://registry.npmjs.org/@fontsource/pt-serif/-/pt-serif-4.1.0.tgz",
35272+ "integrity": "sha512-N2EpV4J0wgrwrNsEUG0wz3uX/wD44Yd3Tnm2vujbFHOCIBSSTAjiOImpl65ac7M7jRXxFnEpHjfofeDKSgvnFg=="
35273+ },
3525235274 "@graphql-tools/batch-execute": {
3525335275 "version": "7.0.0",
3525435276 "resolved": "https://registry.npmjs.org/@graphql-tools/batch-execute/-/batch-execute-7.0.0.tgz",
blog/package.json+2
@@ -6,7 +6,9 @@
66 "dependencies": {
77 "@emotion/core": "^10.0.28",
88 "@fontsource/cormorant-garamond": "^4.1.0",
9+ "@fontsource/cormorant-sc": "^4.1.0",
910 "@fontsource/inter": "^4.1.0",
11+ "@fontsource/pt-serif": "^4.1.0",
1012 "@material-ui/styles": "^4.9.0",
1113 "@mdx-js/mdx": "^1.1.5",
1214 "@mdx-js/react": "^1.1.5",
blog/src/components/MDXProvider.purs+83−99
@@ -36,17 +36,17 @@ import Yoga.FillInTheGaps.Logic (Segment, findResult, parseSegments, toCode)
3636import Yoga.Helpers ((?||))
3737import Yoga as Y
3838
39−type PreProps
40− = { children ∷
39+type PreProps =
40+ { children ∷
41+ Nullable
42+ { props ∷
4143 Nullable
42− { props ∷
43− Nullable
44− { mdxType ∷ Nullable String
45− , children ∷ Nullable String
46− , className ∷ Nullable String
47− }
44+ { mdxType ∷ Nullable String
45+ , children ∷ Nullable String
46+ , className ∷ Nullable String
4847 }
49− }
48+ }
49+ }
5050
5151isQuiz ∷ MDX -> Boolean
5252isQuiz (MDX a) =
@@ -55,9 +55,9 @@ isQuiz (MDX a) =
5555 && ((unsafeCoerce a).props.children.props.mdxType == "code")
5656 && ((unsafeCoerce a).props.children.props.children # parseSegments # isJust)
5757
58−type MdxProviderProps
59− = { children ∷ ReactChildren MDX
60− }
58+type MdxProviderProps =
59+ { children ∷ ReactChildren MDX
60+ }
6161
6262mkLiveMdxProviderComponent ∷ FetchImpl -> Effect (ReactComponent MdxProviderProps)
6363mkLiveMdxProviderComponent fetchImpl = mkMdxProviderComponent (apiCompiler fetchImpl)
@@ -75,38 +75,33 @@ mkMdxProviderComponent compiler = do
7575 visibleUntil /\ updateVisible <- useState 1
7676 let
7777 onFailure title kids = log "Oopsie daisy"
78−
7978 onSuccess = updateVisible (_ + one)
80−
8179 mapVisible ∷ Int -> MDX -> _
8280 mapVisible i kid =
8381 { accum: i + if isQuiz kid then one else zero
8482 , value: if (i < visibleUntil) then Just kid else Nothing
8583 }
86−
8784 visibleKids ∷ Array MDX
8885 visibleKids =
8986 reactChildrenToArray children
9087 # mapAccumL mapVisible zero
9188 # _.value
9289 # Array.catMaybes
93−
9490 contentMDX ∷ ReactChildren MDX
9591 contentMDX = reactChildrenFromArray visibleKids
96−
9792 paragraph parChildren =
9893 E.element M.p
9994 ( { layout: M.layout true
10095 , css:
101− E.css
102− { fontFamily: E.str "Cormorant Garamond"
103− , fontSize: E.str "min(calc(var(--s-1) + 2.4vw), var(--s1))"
104− , lineHeight: E.var "--line-height-small"
105− , "-ms-hyphens": E.str "auto"
106− , "-webkit-hyphens": E.str "auto"
107− , hyphens: E.str "auto"
108− , overflow: E.str "hidden"
109− }
96+ E.css
97+ { fontFamily: E.str "Cormorant Garamond"
98+ , fontSize: E.str "min(calc(var(--s-1) + 2.4vw), var(--s1))"
99+ , lineHeight: E.var "--line-height-small"
100+ , "-msHyphens": E.str "auto"
101+ , "-webkitHyphens": E.str "auto"
102+ , hyphens: E.str "auto"
103+ , overflow: E.str "hidden"
104+ }
110105 , className: "blog-p"
111106 , children: parChildren
112107 }
@@ -114,65 +109,56 @@ mkMdxProviderComponent compiler = do
114109 let
115110 mdxComponents =
116111 { "Sc":
117− \(props :: { children :: String }) ->
118− smallCaps props.children
112+ \(props ∷ { children ∷ String }) ->
113+ smallCaps props.children
119114 , h1:
120− \(props ∷ { | M.MotionProps Props_h1 }) ->
121− React.element M.h1 (props { layout = M.layout true })
115+ \(props ∷ { | M.MotionProps Props_h1 }) ->
116+ React.element M.h1 (props { layout = M.layout true })
122117 , h2:
123− \(props ∷ { | M.MotionProps Props_h2 }) ->
124− React.element M.h2 (props { layout = M.layout true })
118+ \(props ∷ { | M.MotionProps Props_h2 }) ->
119+ React.element M.h2 (props { layout = M.layout true })
125120 , h3:
126− \(props ∷ { | M.MotionProps Props_h3 }) ->
127− React.element M.h3 (props { layout = M.layout true })
121+ \(props ∷ { | M.MotionProps Props_h3 }) ->
122+ React.element M.h3 (props { layout = M.layout true })
128123 , h4:
129− \(props ∷ { | M.MotionProps Props_h4 }) ->
130− React.element M.h4 (props { layout = M.layout true })
124+ \(props ∷ { | M.MotionProps Props_h4 }) ->
125+ React.element M.h4 (props { layout = M.layout true })
131126 , hr: (const $ R.hr {})
132127 , p:
133− \(props ∷ { children :: Array JSX }) ->
134− paragraph props.children
128+ \(props ∷ { children ∷ Array JSX }) ->
129+ paragraph props.children
135130 , inlineCode:
136− \props -> do
137− R.span { children: props.children }
131+ \props -> do
132+ R.span { children: props.children }
138133 , pre:
139− mkFn2 \(props ∷ PreProps) other -> do
140− let
141− childrenQ = Nullable.toMaybe props.children
142−
143− propsQ = (_.props >>> Nullable.toMaybe) =<< childrenQ
144−
145− mdxTypeQ = (_.mdxType >>> Nullable.toMaybe) =<< propsQ
146−
147− childrenQ2 = (_.children >>> Nullable.toMaybe) =<< propsQ
148−
149− classNameQ = (_.className >>> Nullable.toMaybe) =<< propsQ
150−
151− isCode = fromMaybe false (mdxTypeQ <#> eq "code")
152−
153− codeQ = childrenQ2
154−
155− height =
156− (fromMaybe 200 >>> show >>> (_ <> "px")) do
157− code <- codeQ
158− pure
159− ( String.split (String.Pattern "\n") code
160− # Array.length
161− # \x -> (x * 12) + 100
162− )
163−
164− language = fromMaybe "" (classNameQ >>= String.stripPrefix (String.Pattern "language-"))
165−
166− segmentsQ = parseSegments (codeQ ?|| "")
167− case isCode, language, segmentsQ of
168− true, "purescript", Just initialSegments -> element quiz { initialSegments, onFailure, onSuccess }
169− true, _, _ ->
170− element editor
171− { initialCode: fromMaybe "" codeQ
172− , height
173− , language
174− }
175− false, _, _ -> element (unsafePerformEffect $ unsafeCreateDOMComponent "pre") props
134+ mkFn2 \(props ∷ PreProps) other -> do
135+ let
136+ childrenQ = Nullable.toMaybe props.children
137+ propsQ = (_.props >>> Nullable.toMaybe) =<< childrenQ
138+ mdxTypeQ = (_.mdxType >>> Nullable.toMaybe) =<< propsQ
139+ childrenQ2 = (_.children >>> Nullable.toMaybe) =<< propsQ
140+ classNameQ = (_.className >>> Nullable.toMaybe) =<< propsQ
141+ isCode = fromMaybe false (mdxTypeQ <#> eq "code")
142+ codeQ = childrenQ2
143+ height =
144+ (fromMaybe 200 >>> show >>> (_ <> "px")) do
145+ code <- codeQ
146+ pure
147+ ( String.split (String.Pattern "\n") code
148+ # Array.length
149+ # \x -> (x * 12) + 100
150+ )
151+ language = fromMaybe "" (classNameQ >>= String.stripPrefix (String.Pattern "language-"))
152+ segmentsQ = parseSegments (codeQ ?|| "")
153+ case isCode, language, segmentsQ of
154+ true, "purescript", Just initialSegments -> element quiz { initialSegments, onFailure, onSuccess }
155+ true, _, _ ->
156+ element editor
157+ { initialCode: fromMaybe "" codeQ
158+ , height
159+ , language
160+ }
161+ false, _, _ -> element (unsafePerformEffect $ unsafeCreateDOMComponent "pre") props
176162 }
177163 pure
178164 $ element mdxProvider
@@ -180,11 +166,11 @@ mkMdxProviderComponent compiler = do
180166 , components: mdxComponents
181167 }
182168
183−type QuizProps
184− = { initialSegments ∷ Array (Array Segment)
185− , onFailure ∷ String -> Array JSX -> Effect Unit
186− , onSuccess ∷ Effect Unit
187− }
169+type QuizProps =
170+ { initialSegments ∷ Array (Array Segment)
171+ , onFailure ∷ String -> Array JSX -> Effect Unit
172+ , onSuccess ∷ Effect Unit
173+ }
188174
189175mkQuiz ∷ ∀ r. { | Compiler r } -> Effect (ReactComponent QuizProps)
190176mkQuiz compiler = do
@@ -196,24 +182,22 @@ mkQuiz compiler = do
196182 $ element fillInTheGaps
197183 { segments
198184 , run:
199− launchAff_ do
200− let
201− code = toCode segments
202− result <- compiler.compileAndRun { code }
203− liftEffect case result of
204− Right r
205− | String.stripSuffix (String.Pattern "\n") r.stdout == (findResult $ join segments) -> do
206− updateSolvedWith (const $ String.stripSuffix (String.Pattern "\n") r.stdout)
207− onSuccess
208− Right r
209− | r.stdout /= "\n" -> onFailure "Oh shit!" [ R.text r.stdout ]
210− Right r -> onFailure "Oh shit!" [ R.text r.stderr ]
211− Left (cr ∷ CompileResult) -> onFailure "Oh shit!" [ R.text (intercalate ", " (cr.result <#> _.message)) ]
185+ launchAff_ do
186+ let code = toCode segments
187+ result <- compiler.compileAndRun { code }
188+ liftEffect case result of
189+ Right r
190+ | String.stripSuffix (String.Pattern "\n") r.stdout == (findResult $ join segments) -> do
191+ updateSolvedWith (const $ String.stripSuffix (String.Pattern "\n") r.stdout)
192+ onSuccess
193+ Right r
194+ | r.stdout /= "\n" -> onFailure "Oh shit!" [ R.text r.stdout ]
195+ Right r -> onFailure "Oh shit!" [ R.text r.stderr ]
196+ Left (cr ∷ CompileResult) -> onFailure "Oh shit!" [ R.text (intercalate ", " (cr.result <#> _.message)) ]
212197 , updateSegments:
213− \update -> do
214− let
215− updated = update segments
216− unless (segments == updated) do updateSegments (const updated)
198+ \update -> do
199+ let updated = update segments
200+ unless (segments == updated) do updateSegments (const updated)
217201 , solvedWith
218202 }
219203
blog/src/components/PSLayout.purs+90−91
@@ -23,12 +23,12 @@ import Yoga.Block.Icon.SVG as Icon
2323import Yoga.Block.Internal (_0)
2424import Yoga.Block.Modal as Modal
2525
26−type SiteQueryResult
27− = { siteMetadata ∷
28− { title ∷ String
29− , menuLinks ∷ Array { name ∷ String, link ∷ String }
30− }
26+type SiteQueryResult =
27+ { siteMetadata ∷
28+ { title ∷ String
29+ , menuLinks ∷ Array { name ∷ String, link ∷ String }
3130 }
31+ }
3232
3333data ShowModal
3434 = ShowModal Modal.Props
@@ -53,46 +53,44 @@ mkLayout fetchImpl = do
5353 <#> case _ of
5454 DarkMode -> ToggleIsRight
5555 LightMode -> ToggleIsLeft
56−
5756 darkThemeToggle =
5857 Block.toggle
5958 Y.</> do
6059 { className: "dark-light-toggle"
6160 , css:
62− Emotion.css
63− { marginRight: Emotion.str "0"
64− , marginLeft: Emotion.str "auto"
65− }
61+ Emotion.css
62+ { marginRight: Emotion.str "0"
63+ , marginLeft: Emotion.str "auto"
64+ }
6665 , setTogglePosition:
67− case _ of
68− ToggleIsLeft -> setDarkOrLightMode (Just LightMode)
69− ToggleIsRight -> setDarkOrLightMode (Just DarkMode)
66+ case _ of
67+ ToggleIsLeft -> setDarkOrLightMode (Just LightMode)
68+ ToggleIsRight -> setDarkOrLightMode (Just DarkMode)
7069 , togglePosition: fromMaybe ToggleIsLeft maybeTogglePosition
7170 , left:
72− Block.icon
73− Y.</> do
74− { icon: Icon.moon
75− , stroke: Emotion.str "#eef"
76− }
71+ Block.icon
72+ Y.</> do
73+ { icon: Icon.moon
74+ , stroke: Emotion.str "#eef"
75+ }
7776 , right:
78− Block.icon
79− Y.</> do
80− { icon: Icon.sun
81− , stroke: Emotion.str "yellow"
82− }
77+ Block.icon
78+ Y.</> do
79+ { icon: Icon.sun
80+ , stroke: Emotion.str "yellow"
81+ }
8382 , backgroundLeft:
84− Color.hsl 205.0 1.0 0.80
83+ Color.hsl 205.0 1.0 0.80
8584 , backgroundRight:
86− Color.hsl 250.0 1.0 0.1
85+ Color.hsl 250.0 1.0 0.1
8786 }
88−
8987 header =
9088 Block.box
9189 </ { className: "top-box"
9290 , css:
93− Emotion.css
94− { background: Emotion.str colour.backgroundLayer5
95− }
91+ Emotion.css
92+ { background: Emotion.str colour.backgroundLayer5
93+ }
9694 }
9795 /> [ Block.cluster
9896 </* { justify: "space-between"
@@ -105,13 +103,13 @@ mkLayout fetchImpl = do
105103 R.span'
106104 { className: "blog-header"
107105 , css:
108− Emotion.css
109− { fontSize: Emotion.str "min(var(--s3), calc(var(--s1) + 1vw))"
110− , textTransform: Emotion.str "uppercase"
111− , letterSpacing: Emotion.str "calc(min(var(--s0) + 3vw), var(--s2) * -1.7)"
112− , fontWeight: Emotion.str "300"
113− , color: Emotion.str colour.text
114− }
106+ Emotion.css
107+ { fontSize: Emotion.str "min(var(--s3), calc(var(--s1) + 1vw))"
108+ , textTransform: Emotion.str "uppercase"
109+ , letterSpacing: Emotion.str "calc(min(var(--s0) + 3vw), var(--s2) * -1.7)"
110+ , fontWeight: Emotion.str "300"
111+ , color: Emotion.str colour.text
112+ }
115113 }
116114 [ R.text siteInfo.siteMetadata.title ]
117115 , darkThemeToggle
@@ -121,61 +119,62 @@ mkLayout fetchImpl = do
121119 $ element Container.component
122120 { themeVariant: darkOrLightMode
123121 , content:
124− Y.styled Block.stack
125− { className: "blog-content"
126− , space: _0
127− , splitAfter: 2
128− , css:
122+ Y.styled Block.stack
123+ { className: "blog-content"
124+ , space: _0
125+ , splitAfter: 2
126+ , css:
127+ Emotion.css
128+ { minHeight: Emotion.vh 100.0
129+ , background: Emotion.str colour.background
130+ , borderRadius: Emotion.str "0 var(--s1) var(--s1) 0"
131+ }
132+ }
133+ [ header
134+ , Block.centre
135+ </* { className: "centre"
136+ , padding: _0
137+ , gutters: _0
138+ , css: Emotion.css { maxWidth: Emotion.ch 90.0 }
139+ }
140+ /> [ Block.box
141+ </ do
142+ { padding: Emotion.px 16
143+ , css:
144+ Emotion.css
145+ { "& > p:first-of-type:first-letter":
146+ Emotion.nested
147+ $ Emotion.css
148+ { overflow: Emotion.str "visible"
149+ , float: Emotion.str "left"
150+ , fontSize: Emotion.str "min(calc(var(--s0) * 1 + 8.03vw), var(--s5))"
151+ , fontFamily: Emotion.str "Cormorant Garamond"
152+ , lineHeight: Emotion.str "min(calc(var(--s-1) + 2px + 3vw), var(--s3))"
153+ , marginTop: Emotion.str "min(calc(var(--s-1) + 1.5vw), var(--s2))"
154+ , marginRight: Emotion.var "--s-2"
155+ , "&::selection":
156+ Emotion.nested
157+ $ Emotion.css
158+ { color: Emotion.str colour.highlightText
159+ , background: Emotion.str colour.highlight
160+ }
161+ }
162+ }
163+ }
164+ /> [ element mdxProviderComponent
165+ { children
166+ }
167+ ]
168+ ]
169+ , Y.styled Block.box
170+ { className: "blog-footer"
171+ , css:
129172 Emotion.css
130− { minHeight: Emotion.vh 100.0
131− , background: Emotion.str colour.backgroundLayer5
132− , borderRadius: Emotion.str "0 var(--s1) var(--s1) 0"
133− }
134− }
135− [ header
136− , Block.centre
137− </* { className: "centre"
138− , padding: _0
139− , gutters: _0
140− , css: Emotion.css { maxWidth: Emotion.ch 90.0 }
173+ { background: Emotion.str colour.backgroundLayer1
174+ , borderTop: Emotion.str $ "1px solid " <> colour.backgroundLayer3
175+ , color: Emotion.str colour.text
141176 }
142− /> [ Block.box
143− </ do
144− { padding: Emotion.px 16
145− , css:
146− Emotion.css
147− { "& > p:first-of-type:first-letter":
148− Emotion.nested
149− $ Emotion.css
150− { overflow: Emotion.str "hidden"
151− , float: Emotion.str "left"
152− , fontSize: Emotion.str "min(calc(var(--s0) * 1 + 8.03vw), var(--s5))"
153− , lineHeight: Emotion.str "min(calc(var(--s-1) + 2px + 3vw), var(--s3))"
154− , marginTop: Emotion.str "min(calc(var(--s-1) + 1.5vw), var(--s2))"
155− , marginRight: Emotion.var "--s-2"
156− , "&::selection":
157− Emotion.nested
158− $ Emotion.css
159− { color: Emotion.str colour.highlightText
160− , background: Emotion.str colour.highlight
161− }
162− }
163− }
164− }
165− /> [ element mdxProviderComponent
166− { children
167− }
168− ]
169− ]
170− , Y.styled Block.box
171− { className: "blog-footer"
172− , css:
173− Emotion.css
174− { background: Emotion.str colour.backgroundLayer1
175− , borderTop: Emotion.str $ "1px solid " <> colour.backgroundLayer3
176− , color: Emotion.str colour.text
177− }
178− }
179− [ R.text "Mark Eibes" ]
180− ]
177+ }
178+ [ R.text "Mark Eibes" ]
179+ ]
181180 }
blog/src/components/fonts.js+7−4
@@ -1,5 +1,8 @@
11// Fonts
2−import "@fontsource/cormorant-garamond/500.css"
3−import "@fontsource/cormorant-garamond/500-italic.css"
4−import "@fontsource/cormorant-garamond/700.css"
5−import "@fontsource/cormorant-garamond/700-italic.css"
2+import "@fontsource/cormorant-garamond/latin-ext-500.css"
3+import "@fontsource/cormorant-garamond/latin-ext-500-italic.css"
4+import "@fontsource/cormorant-garamond/latin-ext-600.css"
5+import "@fontsource/cormorant-garamond/latin-ext-600-italic.css"
6+import "@fontsource/cormorant-garamond/latin-ext-700.css"
7+import "@fontsource/cormorant-garamond/latin-ext-700-italic.css"
8+import "@fontsource/cormorant-sc/latin-ext-500.css"
blog/src/purescript/Typography/SmallCaps.purs+4−4
@@ -8,15 +8,15 @@ import React.Basic.Hooks (JSX)
88import React.Basic.Hooks as React
99import Yoga as Y
1010
11−mkSmallCaps :: Effect (String -> JSX)
11+mkSmallCaps ∷ Effect (String -> JSX)
1212mkSmallCaps = do
1313 React.component "SmallCaps" \text -> React.do
1414 pure
1515 $ Y.styled R.span'
1616 { className: "small-caps"
1717 , css:
18− E.css
19− { fontVariant: E.str "small-caps"
20− }
18+ E.css
19+ { fontFamily: E.str "'Cormorant SC'"
20+ }
2121 }
2222 [ R.text $ text ]