-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Custom styling #2
Comments
I know about The majority of the client is the UI, and the HTML and CSS involved are very specifically dependent on each other. I'm considering the possibility of separating out the client logic & generalising the |
Ok, no problem. Yeah, I'd like to fix the following issue: the highlighted text is white with yellow background when the result is selected. So I don't know if there's variable in the themes object to handle this. Other thing that I'd like to change is differentiate a selected element from a element with |
Ah, thanks, not sure how I missed that. It's not meant to be yellow at all, I'll release a patch for that soon.
Good idea. I'm thinking an outline for select elements and the current fill for hovered elements, I'll see how it looks when I test it. |
Those styling issues have been fixed by v0.3.2, but I'll leave this open to come back to the idea of custom styling for future updates. |
Hi.
As I can see, this component use a style tag in the shadow root to apply styles and use themes to apply colors and fonts.
I recommend to use CSS
::part()
pseudo selector for more flexibility and maintainability.You can see an example of this in the oom-components/searcher web component:
part
attribute: https://github.com/oom-components/searcher/blob/main/searcher.js#L37:hover
,:focus
,:disabled
etc: https://github.com/oom-components/searcher/blob/main/demo/styles.css#L9-L16This would make more easy to apply styles on different media queries, light/dark themes, etc. For example:
And it allows to combine a base theme in the shadow DOM that can be overrided by outside css.
The text was updated successfully, but these errors were encountered: