Closed pinx closed 7 years ago
Yes at some point I'll plan to migrate the CSS over to elm-css, there are some issues with generating CSS on the fly that needs to be weighed before committing to it though, also I want to wait until a stable release is ready (both elm-ui and elm-css).
I'll keep this issue open for discussion.
@gdotdesign this is a cool project! I'm not sure what the issues are with generating CSS on the fly, but happy to help and talk through things! 😸
@rtfeldman thanks for offering you help :smile:
So there are a couple of things that needs to be considered about this issue, I'll start with explaining how things currently are and what are the possible alternatives I see for it in elm-css:
ui-app
or ui-button
), this is mainly because they are not predefined with any styles and it's not likely that any library or framework can effect them. As I seen there is no way other then using Css.selector
which I might behaves differently then a Css.Element
(I didn't really dive into the source yet)Css.Mixin
, though I'm not sure how complex nested selectors would work (for example https://github.com/gdotdesign/elm-ui/blob/master/stylesheets/ui/states/picker.scss)elm-color-mixing
packageIn a different project we are generating CSS on the fly from a tree like component structure where components can inherit from each other so I have some experience from there, also using autoprefixer there as well:
So summing up the requirements:
Huh that ended up more than I though :sweat_smile:
I've taken an interest in getting this converted over to elm-css. I've started with implementing scale-color and have submitted a PR for it here.
That's awesome! :)
I've started to migrate some of the CSS in the scoped-css branch: https://github.com/gdotdesign/elm-ui/compare/github-install...scoped-css the scoping and styledNode
is as it turns out is a bad idea for multiple reasons, but the rest of the styles can be used as a starting point.
Sounds good! For any work I do on this, should I branch off the scoped-css branch and submit PR's to that branch?
No, please create a branch from master, and start the styles in a separate directory somewhere.
Just ignore this module https://github.com/gdotdesign/elm-ui/blob/scoped-css/source/Ui/Styles/Html.elm because it's problematic to go this way.
So what I think we should do is just converting the styles to elm-css as is, meaning one style tag or one external file in the end.
I've migrated all Sass stylesheets to Elm with the 1.0.0 release. I've opted for not using elm-css at this stage, but instead created a more Sass like version of it.
If any of you are interested in how it works check out these files: https://github.com/gdotdesign/elm-ui/blob/master/source/Css/Properties.elm https://github.com/gdotdesign/elm-ui/blob/master/source/Css.elm https://github.com/gdotdesign/elm-ui/blob/master/source/Ui/Styles/Theme.elm https://github.com/gdotdesign/elm-ui/blob/master/source/Ui/Styles.elm https://github.com/gdotdesign/elm-ui/blob/master/source/Native/Styles.js
And the styles are living here: https://github.com/gdotdesign/elm-ui/tree/master/source/Ui/Styles
It should not be hard to migrate them over to use elm-css provided it supports all of the features they need.
I'm closing this since it's been implemented (sort of).
https://github.com/rtfeldman/elm-css is nearly out of beta. Maybe an interesting candidate to integrate in elm-ui.