Adds Miso.Style#920
Conversation
- [ ] Add additional combinators / strong types - [ ] Update examples to use new style_ combinator - [x] Add Miso.Style.Color
There was a problem hiding this comment.
Copilot reviewed 2 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (13)
- examples/fetch/Main.hs: Language not supported
- examples/mario/Main.hs: Language not supported
- examples/svg/Main.hs: Language not supported
- examples/websocket/Main.hs: Language not supported
- haskell-miso.org/shared/Common.hs: Language not supported
- miso.cabal: Language not supported
- src/Miso.hs: Language not supported
- src/Miso/Html/Element.hs: Language not supported
- src/Miso/Html/Property.hs: Language not supported
- src/Miso/Html/Types.hs: Language not supported
- src/Miso/Property.hs: Language not supported
- src/Miso/Svg/Attribute.hs: Language not supported
- src/Miso/Svg/Element.hs: Language not supported
This reverts commit 3eb91e3.
11bef52 to
2db7d67
Compare
| intProp = prop | ||
| ----------------------------------------------------------------------------- | ||
| -- | Set field to `Integer` value | ||
| integerProp :: MisoString -> Int -> Attribute action |
There was a problem hiding this comment.
| integerProp :: MisoString -> Int -> Attribute action | |
| integerProp :: MisoString -> Integer -> Attribute action |
There was a problem hiding this comment.
Let's keep it Int, if you want to rename it then do intProp
There was a problem hiding this comment.
but honestly, probably best to just leave it for now, since its a big breaking change
There was a problem hiding this comment.
But then the function name and haddock above it are lying.
What's the purpose of having both intProp and integerProp with identical type signature?
There was a problem hiding this comment.
I believe BigInt wasn’t supported at the time miso was released. The Integer implementation was much slower, I’ll need to look into this more.
| stringProp = prop | ||
| ----------------------------------------------------------------------------- | ||
| -- | Set field to `Text` value | ||
| textProp :: MisoString -> MisoString -> Attribute action |
There was a problem hiding this comment.
| textProp :: MisoString -> MisoString -> Attribute action | |
| textProp :: MisoString -> Text -> Attribute action |
There was a problem hiding this comment.
in that case just update the Haddock above this not to mention Text 🙂
There was a problem hiding this comment.
MisoString becomes Text on GHC and stays JSString on WASM / JS
| -- | 'StyleSheet' | ||
| -- | ||
| -- Type for a CSS style on native | ||
| -- |
There was a problem hiding this comment.
It's Map from MisoString to Styles, which itself is Map from MisoString to Miso String.
Maybe add a sentence about what the keys / values at each level are? The same for sheet_ below.
| -- | 'renderStyleSheet' | ||
| -- | ||
| -- Renders a 'StyleSheet' to a 'MisoString' |
There was a problem hiding this comment.
This comment belongs to the function below?
| , (=:) | ||
| -- *** Render | ||
| , renderStyleSheet | ||
| -- *** Combinators |
There was a problem hiding this comment.
Just curious: what is your source for this list of css properties you're creating combinators for?
Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
|
We'll come back to this, we might take a full lexer / parser approach to CSS. Have to move back onto docs and native, we'll keep fleshing it out piecemeal on-demand. |
style_combinatorMiso.Style.Colorstyle_HTML combinator (this is whyMiso.Stylemust be used qualified)Addresses #746
@jhrcek