Closed nathanbabcock closed 2 months ago
Hmmm, yeah I tried to find a middle ground here between out of the box utility styling and ability to customise easily.
The intent is you should be able to import the styles as you were doing to get basic useful styles applied (without any tailwind etc). From your debugging (thanks for the detail!) it does look like I'm not accounting for some styles in the built style css - I'll look at fixing that.
That's awesome, ty for the quick reply. I was able to customize the styles pretty easily once I followed the "Styling" demo on the site.
Release 0.15.0 has now been published which should address this.
I noticed some aspects of the styling are inherited from the demo site, including global resets and other custom selectors, that aren't included in
style.css
in the npm package.I imported the default styles with this statement in my Solid component:
I double-checked the styles panel in Devtools to confirm that style definitions are actually being applied to elements like
.solid-select-control
and others (they are).This is what the component looks like in my app as a starting point:![solid-select-styling](https://user-images.githubusercontent.com/9583103/222259106-40b955bf-b50a-4c04-bb76-38be2fab5581.png)
Some tweaking is to be expected of course, especially since my app is dark mode. But it is also missing borders and background colors.
Borders
Border definitions are dependent on this global reset that is included on the demo site, but not the style package:
Since I don't have an implicit
border-style: solid
on every element, none of the border styles get applied.Backgrounds
Background color is defined by this statement that is only included in the demo site:
To be honest I don't even fully understand what this selector means. It looks like a pseudo-element, but it's escaped with a backslash. In any case, it's not included in
@thisbeyond/solid-select/style.css
, which instead setsbackground: transparent
.Other
I just realized what the problem is, maybe. I assume these
--tw-*
variables are referring to Tailwind. My app doesn't use it, and the Readme never mentioned it. Do I need to use Tailwind to style this component correctly?I apologize if this is intended behavior, or if I'm misunderstanding something about how the styles should be imported. I just found it difficult to use or even to understand what is causing the default styling.