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

CSS Custom Properties #156

Closed
kevinSuttle opened this Issue Aug 26, 2016 · 9 comments

Comments

Projects
None yet
3 participants
@kevinSuttle

kevinSuttle commented Aug 26, 2016

Is the recommended syntax for "CSS variables Custom Properties" covered by this function?

https://github.com/rtfeldman/elm-css/blob/master/src/Css.elm#L5105

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

lukewestby Sep 18, 2016

Collaborator

Can you share some more context on what the recommended syntax for CSS Custom Properties is?

Collaborator

lukewestby commented Sep 18, 2016

Can you share some more context on what the recommended syntax for CSS Custom Properties is?

@kevinSuttle

This comment has been minimized.

Show comment
Hide comment
@kevinSuttle

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/

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

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

Collaborator

lukewestby commented Sep 18, 2016

gotcha! i think the root function is what you're looking for

https://github.com/rtfeldman/elm-css/blob/master/src/Css.elm#L5389

@lukewestby lukewestby added the question label Sep 18, 2016

@kevinSuttle

This comment has been minimized.

Show comment
Hide comment
@kevinSuttle

kevinSuttle Sep 18, 2016

Cool. That covers :root. How about the custom properties?

kevinSuttle commented Sep 18, 2016

Cool. That covers :root. How about the custom properties?

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

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

Collaborator

lukewestby commented Sep 18, 2016

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

@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

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?

Collaborator

eeue56 commented Sep 19, 2016

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?

@kevinSuttle

This comment has been minimized.

Show comment
Hide comment
@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

eeue56 Sep 19, 2016

Collaborator

I already answered in that thread, I am Noah.

Collaborator

eeue56 commented Sep 19, 2016

I already answered in that thread, I am Noah.

@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

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 :)

Collaborator

eeue56 commented Sep 19, 2016

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 :)

@eeue56 eeue56 closed this Sep 19, 2016

@eeue56 eeue56 added the wontfix label Sep 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment