CSS framework independence #296
jrief
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
hi @jrief, how can this wrapper be used? can it be pulled from a CDN ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a wrapper for TomSelect which renders the widget inside its own shadow-root. One of the nice features is that by doing so, TomSelect becomes independent from CSS frameworks and can by styled by just using that framework without adding any line of extra CSS. This means that you can use the vanilla CSS file from any framework and the TomSelect-widget will adopt to exactly that style, as the
<select>
-widget would appear in the given framework.Here are a few examples. I created a form with 3 fields for demonstration purpose.
<select>
-field. It shows how the CSS framework would style such a field.<select>
-field is "copied" over and applied to itself.<input type="text">
-field.Bootstrap 5
Bulma
Foundation 6
Tailwind
The code for this wrapper can be found here.
Beta Was this translation helpful? Give feedback.
All reactions