[WIP] Implement design system button#748
Conversation
|
In general it looks fine for me. Thank you for doing the research.' Are we going to use https://github.com/SolidOS/solid-assets for global variables? |
Can you elaborate what you mean? Is it the fact that we have to import each icon individually? Or you don't like the idea of having a web component for each icon? To clarify, this is how we'd use icons with this new approach: <solid-ui-button>
Confirm
<icons-lucide-check></icons-lucide-check>
</solid-ui-button>If you're looking at the code in the storybook, that is indeed more confusing than this. But that's only because we are trying to render icons dynamically. And maybe it could be done more elegantly, but given that it's just storybook code I don't care about it as much as production code. The real problem I would agree with is the need to import each icon, as I mentioned... But I'm not sure it's easy to solve with our current setup, unfortunately :(. Other than that, this is very close to how I've been using icons in my apps for years and the DX is pretty good (we could also configure that
I didn't know the variables came from there, I thought they were defined in mashlib. In any case, they should definitely be declared in a single place, and imported from whatever packages publishes them elsewhere. I would vote for exporting them from this package ( |
This PR introduces a first draft for how we could implement components moving forward, following the design system from Figma.
Some things to note:
src/design-system/styles/main.css). The current global variables should be removed from mashlib, and if needed for reuse, we could export them from this package in some way.design-systemfolder temporarily, once we settle on the final conventions and start migrating all components we should think about folder organization and how to import/export various bundles.src/design-system/lib/iconsand how icons are rendered (using<icon-lucide-plus>, etc.). The main drawbacks is that we still have to import individual icons, rather than being resolved individually. Otherwise we could import the entire icon collection. But I haven't found a way to resolve this dynamically using web components.So, this is still a draft but I think it's very close to what I'd like to have eventually. So now it would be a good point to give feedback if there is anything at all you don't like about this PR :).
PS: You can see a temporary deployment of the storybook for this code here: https://noeldemartin.github.io/solid-ui/?path=/docs/design-system-button--docs