-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improvements to color customization #1614
base: master
Are you sure you want to change the base?
Conversation
This helps dark mode implementation
This is great thanks, Anthony! I love its flexibility - how you can just set the main Some feedback:
|
Hi Jack, Thanks for reviewing this so quickly.
Yes, it's not a problem I understand the concern, I use ITI at work and every time there is an update I take a look at what changed, commits / issues ETC. (Because of how critical this part of code is to us)
Yes, I get your point, I would use
🤦🏻♂️ My mistake I used W3 instead of MDN. Also, I forgot the project doesn't have IE/old Edge support.
https://dev.to/samanthaming/styling-placeholder-text-with-css-2he0
Very good catch. I will fix it.
😓 Good documentation is like a good movie... I can't make either. (but, I will try) I made the changes, There were some cases that I have now improved, that I would not have found if I had not made the improvements |
This sounds great, thanks so much, Anthony. I'm away tomorrow, but I will take another look at this on Wednesday 👍 |
Actually, thinking about it, I don't think inherit/unset will work e.g. for input bg colour, on a page which has a bg colour other than white, the input bg colour in this case will be transparent, which is wrong (a breaking change). I just tested this with both inherit and unset. Not sure how to handle this... needs more thought! 🤔 |
Just spitballing here, but could you do something like this: (pseudo code): @media dark mode {
.iti input {
background-color: var(--iti-input-bg);
}
} Without defining The question is: can you reference a CSS var before you have defined it? |
Yes you can reference the var before it is defined, also fyi you can default them.
https://developer.mozilla.org/en-US/docs/Web/CSS/var I don’t understand the problem exactly but I will try understand it better tomorrow. could you please provide a screenshot or proof of concept to help me out. |
[UNTESTED] I thiiiink... if you just take your code, and open the demo.html and change the body background colour to red, I think the input bg colour will change to red as well. Which is a breaking change - it should stay white. |
I see the problems now. The input shows as red instead of white. The white came from the User Agent Style Sheet, and the color was set to |
😂 you did great!
You learn a new thing every day! Good catch.
This seems to be working well 👍 On this subject, I realised that while One other issue I found was that the new border-radius styling looks weird on Firefox and Safari - when you open the dropdown, and the search input gets the blue focus outline, it has curved corners at the top, and sharp corners on the bottom. Can we change this back to having radius on all 4 corners? Finally, I found something really annoying! The new |
I will try to take a look at this tomorrow. |
I haven't been able to get to it this week. |
No worries at all. No rush from my end 👍 |
Breaking changes to variable names:
--iti-text-gray -> --iti-dialcode-color
--iti-border-gray -> --iti-border-color
This pull request makes customizing colors easier and a small improvement to the search box.
This is in response to #1608, specifically:
By making just those changes the result is not good. you need to customize a few more things.
if the pull request is applied you will be able to do this (with the colors you want obviously)
Because there are so many variations of dark mode, This solution makes it more customizable.
This pull doesn't have: