Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCSS Custom Properties #156
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Sep 18, 2016
Collaborator
Can you share some more context on what the recommended syntax for CSS Custom Properties is?
|
Can you share some more context on what the recommended syntax for CSS Custom Properties is? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kevinSuttle
Sep 18, 2016
Sure.
Normally they're declared inside the global root selector
:root {
--primaryThemeColor: #b4d4ss;
}
.newsfeed {
background-color: var(--primaryThemeColor);
}https://philipwalton.com/articles/why-im-excited-about-native-css-variables/
kevinSuttle
commented
Sep 18, 2016
|
Sure. Normally they're declared inside the global root selector :root {
--primaryThemeColor: #b4d4ss;
}
.newsfeed {
background-color: var(--primaryThemeColor);
}https://philipwalton.com/articles/why-im-excited-about-native-css-variables/ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Sep 18, 2016
Collaborator
gotcha! i think the root function is what you're looking for
https://github.com/rtfeldman/elm-css/blob/master/src/Css.elm#L5389
|
gotcha! i think the https://github.com/rtfeldman/elm-css/blob/master/src/Css.elm#L5389 |
lukewestby
added
the
question
label
Sep 18, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kevinSuttle
commented
Sep 18, 2016
|
Cool. That covers |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Sep 18, 2016
Collaborator
property should work for both cases
[ root
[ property "--primaryThemeColor" "#b4d4ss" ]
, (.) NewsFeed
[ property "background-color" "var(--primaryThemeColor)" ]
]I know it's not ideal but it'll get the job done until a typesafe representation of this part of the spec is added to the API
|
[ root
[ property "--primaryThemeColor" "#b4d4ss" ]
, (.) NewsFeed
[ property "background-color" "var(--primaryThemeColor)" ]
]I know it's not ideal but it'll get the job done until a typesafe representation of this part of the spec is added to the API |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eeue56
Sep 19, 2016
Collaborator
Eh, I don't think they should ever get included. What's the benefit of doing a CSS variable when you can just do an Elm one?
|
Eh, I don't think they should ever get included. What's the benefit of doing a CSS variable when you can just do an Elm one? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kevinSuttle
commented
Sep 19, 2016
|
@lukewestby Funny you say that. https://groups.google.com/forum/#!topic/elm-discuss/vvJGw1u7NVQ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I already answered in that thread, I am Noah. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eeue56
Sep 19, 2016
Collaborator
I don't think this will go anywhere. I don't think there's any point supporting it beyond what you can already do. Reading through the custom property spec confirms this belief - there's nothing in there that wouldn't be better done in Elm land. SASS have this issue where they discuss all things CSS in terms of keeping features in order to be a superset of CSS. In Elm-Css, we don't need to worry about that. It's possible to do this through the methods described by luke above, but the recommendation is that you should just use Elm, because that's the whole point of Elm-Css.
If anyone disagrees, please open an issue with an explicit use case and examples of where that would be helpful :)
|
I don't think this will go anywhere. I don't think there's any point supporting it beyond what you can already do. Reading through the custom property spec confirms this belief - there's nothing in there that wouldn't be better done in Elm land. SASS have this issue where they discuss all things CSS in terms of keeping features in order to be a superset of CSS. In Elm-Css, we don't need to worry about that. It's possible to do this through the methods described by luke above, but the recommendation is that you should just use Elm, because that's the whole point of Elm-Css. If anyone disagrees, please open an issue with an explicit use case and examples of where that would be helpful :) |
kevinSuttle commentedAug 26, 2016
Is the recommended syntax for "CSS
variablesCustom Properties" covered by this function?https://github.com/rtfeldman/elm-css/blob/master/src/Css.elm#L5105