-
Notifications
You must be signed in to change notification settings - Fork 93
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
Color palettes #75
Comments
That would be neat! After talking to @cdata I think an easy way to do this that (might) work is to make a I'll try to take a look at this week! Thanks for the suggestion! |
I'm actually a bit confused by the recent changes to |
In the past, So, in your code, if you want the text to be dark, because your backgrounds are light, you should use the |
@notwaldorf But as a component consumer I will be deciding whether I want my site to use a dark or light theme, so if I want it dark yet the component creator made it light then I would have to set the |
Is the question just about the "deprecated" comment? I can remove it (it's really just |
Alright, let me know if #89 makes more sense |
@notwaldorf The point @bendavis78 correctly raised is that right now there are specific css variables for the light and dark theme which makes no sense whatsoever: So, I produce a component, let's say a
auch Either way, it would be best to deprecate things like
or
which will automatically generate the following
what do you think? |
First of all, I understand your comment about having an element that automatically generates themes. I already said that's a good idea, and I've started looking into it. That element is orthogonal to providing the default light and dark Material Design themes, and is completely unrelated to @bendavis78;s question. I think you misunderstood what I originally tried to explain. If you look at In your demo page, where you are using : root {
--primary-text-color: red;
} If you want to change everything from light to dark, then you would change the 5 values in the first section (https://github.com/PolymerElements/paper-styles/pull/89/files#diff-fba59d2899b10cb0edb072669a58ffd1R24) to their dark equivalents, and this would update all the elements. I have never disagreed with generating a color palette is a good idea, and it will eventually happen. However, in the meantime I don't see a problem with giving people the set of values for the two default Material Design palettes. You don't have to use these properties unless they're useful to you, and they change absolutely nothing from what paper-styles did before this change. |
Wait, are you suggesting that the dark and light variables should never be used by element authors? Because if so that would kind of make sense, but that should be very clearly communicated! And as far as generating the palette, the reason I went out of my way to outline those things was because I wanted to make clear which variables as a component author I need access to based on the MD spec. Importantly noting that |
I am not suggesting that. You can use any variables as you please. Maybe you don't want an element to be themable, in the same way you can literally hard code any colour in your element. But generally, not, you as an element author would probably not use the I think /cc @cdata |
So, I worked out a bit of a proposal both on the variable side (which variables should be exposed and why the idea of https://github.com/David-Mulder/paper-theme |
@David-Mulder That's super neat! |
DISCLAIMER: I am fairly new to Polymer. I read this issue a million times, and it really really really confused me. Definitely not a seasoned element author like @bendavis78 and most definitely not a Polymer guru like @notwaldorf . Having said this. @notwaldorf I would like to submit a PR documenting exactly:
This issue is unfortunate because it mixes different things. However, I didn't have the heart to create yet another one -- especially since what I propose is a draft. So, I think I'd much rather pollute this one, and get the "OK" in terms of what I think the document should contain. Now, let me try to answer the existing statements. First things first: @danrschlosser
I don't think so.
But
Or:
And you, as a good producer, would use
I think component creators should simply use
So I think here the rule is "element authors should try their very best to be colour-agnostic, and use the theme's default colours whenever possible.
No, if you produce
As small correction -- very humbly -- if I may... this sentence should be:
Also:
I am not sure about this. I actually think that would be unideal as best, since I see the light- and dark- variables as ways to set defaults for a consumer, which uses them to set the "real" ones ( Lastly, I think most of the confusion here comes from the fact that (BTW the use of @notwaldorf Is there another use case, other than an element consumer who wants to redefine those variables to the default (dark or light) theme? Hey @mercmobly, where is the proposal?!?I hope I clarified some issues so that the next person finding this issue will be able to make heads of tails of this. I also hope I got things right and, if needed, straightened out. Please keep in mind that I am doing this very, very humbly. In terms of my proposal, please allow me to put forward an outline. If I didn't write anything stupid (which would surprise me), I will flesh it out. Theming guidelinesOverview of the default theming variables in paper elementsThe default theme is defined in
Remember that this is the default theme. These variables should be changed. As an element consumerAs an element consumer, you are encouraged to redefine the basic properties (typography, primary color, accent color) by setting these variables in your own CSS, after including your elements:
In your
Note that while for typography the same defaults are applied (in the light-theme set), you are free to use whichever color works for your application, or use the dark-theme presets. For primary and accent colors, in this case, the deep-purple colors were used as primary colors. Most (hopefully all) custom elements will pick up on your typography variables as defaults. As an element producerElements should be as color-agnostic as possible, and use the default properties as much as possible. For example, a custom element
This will ensure that the element's colors are customizable, and -- if customization by the user didn't happen -- they have sane defaults based on the theme variables. ConclusionPhew! I hope my answers and my writeup make sense. @notwaldorf One thing I didn't quite understand is, this: why don't theme pages include
...? I didn't do this in the guide because well, it's not done anywhere in Polymer (not in All this is a huge derail from the original issue. I decided to added it here because the original issue couldn't really get much worse (but maybe it did!). @notwaldorf If you think the writeup is worthwhile expanding, please let me know. I will make a PR and we'll go from there. About the original issueI agree that having a way to automatically generate the palette would be grand. Something where you define the primary color and the accent color, and it generates color-agnostic primary and accent names. @notwaldorf Thanks for looking into it! |
Hi folks - I made a documentation PR to cover what I understand to be the most basic and common example of overriding colors, globally defining your primary and accent colors. Thanks so much for the discussion around this topic, this issue was key to figuring out how how to accomplish this. |
The material design spec often talks about stuff like:
which as far as I know the best way to go about is using something like
--paper-pink-50
for the defaultapp-theme.html
, however it sucks that the consumer of an element next has to go through all elements to manually set the the respective values up. Wouldn't it be better to have palettes likeand then use the correct respective colors wherever we need them. Sure, I get that it takes a bit longer to set it up when you start off, but a simple element could help out a lot there in that case (
<paper-theme primary="indigo" accent="red">
) and that way you would be 99% done in seconds.The text was updated successfully, but these errors were encountered: