Skip to content
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

[Feature Request] Allow color configuration for placeholder text #10

Closed
3raxton opened this issue Dec 9, 2021 · 3 comments
Closed

[Feature Request] Allow color configuration for placeholder text #10

3raxton opened this issue Dec 9, 2021 · 3 comments

Comments

@3raxton
Copy link

3raxton commented Dec 9, 2021

Hey there,

Great work on this, I love it! I'm working on customizing Ninja Keys on my site and am having issues customizing the color of the placeholder text even with custom CSS.

Is it possible to have this added as a CSS variable anytime in the future or does a way to customize the placeholder already exist?

Great work again!

@ssleptsov
Copy link
Owner

Hey @3raxton
Thank you so much!

Yes, I have added simple placeholder text color variable, you can use it like this:

ninja-keys {
   --ninja-placeholder-color: red;
}

or if you will need much more styling you can now use parts to change input/placeholder or wrapper around it.

ninja-keys::part(ninja-input) {
  color: #14b8a6;
}
ninja-keys::part(ninja-input)::placeholder {
  color: #f43f5e;
}
ninja-keys::part(ninja-input-wrapper) {
  background: rgba(244, 63, 93, 0.3);
}

If you will some more styling let me know, here are all available parts right now
https://github.com/ssleptsov/ninja-keys#css-shadow-parts

Cheers

@3raxton
Copy link
Author

3raxton commented Dec 13, 2021

Hey, no problem. Thanks for the hard work and the extra info! I was curious about the parts beforehand and am glad to see that there is also more custom styling here.

I am running into an issue with SVG however. I'd like to know if there is a way to utilize font awesome icons similar to the Material icons. Could this be a possibility?

Thanks again for the hard work!

@ssleptsov
Copy link
Owner

Hey @3raxton,

Right now no, but I think it can be useful - will add support custom font.

But you already can use any custom icon if it's svg (like https://heroicons.com/ or font awesome must have svg too I think)
Example: https://github.com/ssleptsov/ninja-keys/#icons

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants