Skip to content

Add nbsp and noMargin to new Text components module #161

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Changes from all 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
12 changes: 10 additions & 2 deletions src/Lumi/Components2/Text.purs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Lumi.Components2.Text
( Text
( nbsp

, Text
, TextProps, TextType
, text

Expand All @@ -24,14 +26,17 @@ import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Effect.Unsafe (unsafePerformEffect)
import Lumi.Components (LumiComponent, PropsModifier, PropsModifier', lumiComponent, propsModifier)
import Lumi.Components.Color (ColorMap)
import Lumi.Styles (Style, StyleModifier, StyleProperty)
import Lumi.Styles (Style, StyleModifier)
import Lumi.Styles as S
import Lumi.Styles.Theme (LumiTheme(..), TextMap, textFontSize, textLineHeight, textMargin, useTheme)
import React.Basic (JSX, ReactComponent)
import React.Basic.DOM as R
import React.Basic.Emotion as E
import React.Basic.Hooks as Hooks

nbsp :: String
nbsp = " "

-- Text

data Text = Text
Expand Down Expand Up @@ -128,6 +133,9 @@ color f =
S.style \(LumiTheme { colors }) ->
S.css { color: S.color (f colors) }

noMargin :: forall c. TextModifier c
noMargin = S.style_ $ S.css { marginBottom: S.px 0 }

-- Paragraph

type ParagraphProps =
Expand Down