Last active
October 21, 2024 00:43
-
-
Save cmer/4b750d921510bca27f003a20f0efb524 to your computer and use it in GitHub Desktop.
Tom-Select.js Tailwind UI theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright 2023 Carl Mercier | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use the following to reproduce a Tailwind UI Select field with Tom Select | |
*/ | |
@import 'tom-select/dist/css/tom-select'; | |
.ts-control { | |
@apply mt-2 w-full rounded-md border border-gray-300 py-1 px-3 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 h-9 sm:text-sm sm:leading-6; | |
} | |
.ts-control input { | |
@apply !pr-5 text-sm !m-0; | |
} | |
.ts-wrapper.plugin-remove_button .item { | |
@apply rounded-md; | |
} | |
.ts-wrapper.multi .ts-control > div { | |
@apply p-0 m-0 pl-1; | |
} | |
.ts-wrapper.plugin-remove_button .item .remove { | |
@apply border-none text-lg leading-none py-1 rounded-r-lg; | |
} | |
.ts-dropdown { | |
@apply rounded-md border border-solid border-t border-gray-300; | |
} | |
.ts-dropdown [data-selectable].option, .ts-dropdown .no-results { | |
@apply py-2; | |
} | |
.ts-dropdown [data-selectable].option:first-child { | |
@apply rounded-t-md; | |
} | |
.ts-dropdown [data-selectable].option:last-child { | |
@apply rounded-b-md; | |
} | |
.ts-dropdown .create:hover, .ts-dropdown .option:hover, .ts-dropdown .active { | |
@apply bg-indigo-100 text-indigo-900; | |
} | |
.ts-dropdown .spinner { | |
@apply h-auto w-auto; | |
} | |
.ts-dropdown .spinner:after { | |
@apply h-5 w-5 border-2 p-0 my-0 inline-block; | |
} | |
.ts-wrapper:not(.form-control):not(.form-select).single .ts-control { | |
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); | |
background-position: right 0.5rem center; | |
background-repeat: no-repeat; | |
background-size: 1.5em 1.5em; | |
print-color-adjust: exact; | |
} |
Thanks for this!
Thank you for this!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so much!