UNPKG

2.95 kBJavaScriptView Raw
1/*!
2 * Xtend UI (https://xtendui.com/)
3 * @copyright (c) 2017-2022 Riccardo Caroli
4 * @license MIT (https://github.com/xtendui/xtendui/blob/master/LICENSE.txt)
5 */
6
7module.exports = {
8 component: theme => ({
9 '.xt-select': {
10 appearance: 'none',
11 backgroundRepeat: 'no-repeat',
12 paddingRight: '3em',
13 backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${encodeURIComponent(
14 theme('colors.black')
15 )}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>')`,
16 backgroundSize: '1em',
17 backgroundPosition: 'right 1rem center',
18 '&[multiple]': {
19 backgroundImage: 'none',
20 },
21 },
22 '.xt-check': {
23 appearance: 'none',
24 cursor: 'pointer',
25 position: 'relative',
26 flexShrink: '0',
27 backgroundRepeat: 'no-repeat',
28 },
29 '.xt-checkbox': {
30 appearance: 'none',
31 cursor: 'pointer',
32 position: 'relative',
33 flexShrink: '0',
34 backgroundRepeat: 'no-repeat',
35 top: '.25em',
36 width: '1.2375em',
37 height: '1.2375em',
38 backgroundImage: `url('data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" fill="${encodeURIComponent(
39 theme('colors.white')
40 )}" xmlns="http://www.w3.org/2000/svg"><path d="M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z"/></svg>')`,
41 backgroundSize: '0',
42 backgroundPosition: 'top center',
43 '&:checked': {
44 backgroundSize: '100%',
45 },
46 },
47 '.xt-radio': {
48 appearance: 'none',
49 cursor: 'pointer',
50 position: 'relative',
51 flexShrink: '0',
52 backgroundRepeat: 'no-repeat',
53 top: '.25em',
54 width: '1.2375em',
55 height: '1.2375em',
56 backgroundImage: `url('data:image/svg+xml;utf8,<svg viewBox="-6 -6 12 12" fill="${encodeURIComponent(
57 theme('colors.white')
58 )}" xmlns="http://www.w3.org/2000/svg"><circle r="3"/></svg>')`,
59 backgroundSize: '0',
60 backgroundPosition: 'top center',
61 '&:checked': {
62 backgroundSize: '100%',
63 },
64 },
65 '.xt-switch': {
66 appearance: 'none',
67 cursor: 'pointer',
68 position: 'relative',
69 flexShrink: '0',
70 backgroundRepeat: 'no-repeat',
71 top: '.25em',
72 width: '2.25em',
73 height: '1.2375em',
74 backgroundImage: `url('data:image/svg+xml;utf8,<svg viewBox="0 0 36.3 36.3" fill="${encodeURIComponent(
75 theme('colors.white')
76 )}" stroke="${encodeURIComponent(
77 theme('colors.gray.300')
78 )}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><circle cx="18" cy="18" r="17"/></svg>')`,
79 backgroundSize: 'contain',
80 backgroundPosition: 'left center',
81 '&:checked': {
82 backgroundPosition: 'right center',
83 },
84 },
85 }),
86}