Skip to content

Commit e38b7b4

Browse files
committed
created base.styl (this is extended by themes), reduces redundancy
1 parent a0619a5 commit e38b7b4

File tree

5 files changed

+110
-155
lines changed

5 files changed

+110
-155
lines changed

public/components/App.styl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@import "Example"
2-
@require "../../themes/default"
3-
@require "../../themes/bootstrap3"
2+
@require "../../themes"
43

54
body
65

themes/base.styl

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// component skeleton, extended & decorated by themes
2+
.react-selectize
3+
user-select none
4+
position relative
5+
6+
&.disabled
7+
pointer-events none
8+
9+
.react-selectize-control
10+
cursor pointer
11+
display flex
12+
align-items flex-start
13+
position relative
14+
15+
.react-selectize-placeholder
16+
display flex
17+
align-items center
18+
overflow hidden
19+
text-overflow ellipsis
20+
white-space nowrap
21+
position absolute
22+
23+
.react-selectize-selected-values
24+
display flex
25+
flex-grow 1
26+
flex-wrap wrap
27+
28+
.resizable-input
29+
background none
30+
border none
31+
outline none
32+
font-size 1em
33+
margin 2px
34+
padding 4px 0px
35+
vertical-align middle
36+
width 0px
37+
38+
.value-wrapper
39+
display flex
40+
align-items center
41+
42+
.react-selectize-arrow-container, .react-selectize-reset-container
43+
flex-grow 0
44+
flex-shrink 0
45+
cursor pointer
46+
display flex
47+
align-items center
48+
justify-content center
49+
50+
.react-selectize-arrow-container
51+
width 32px
52+
53+
.react-selectize-reset-container
54+
width 16px
55+
56+
.react-selectize-arrow path
57+
fill #999
58+
59+
.react-selectize-reset path
60+
stroke #999
61+
stroke-linecap square
62+
stroke-linejoin mitter
63+
64+
// dropdown-menu-container is present for tethered & animated dropdowns only
65+
.react-selectize.dropdown-menu-container
66+
position absolute
67+
68+
.react-selectize.dropdown-menu
69+
overflow auto
70+
position absolute
71+
z-index 10
72+
73+
.groups.as-columns
74+
display flex
75+
> div
76+
flex 1
77+
78+
.option-wrapper
79+
cursor pointer
80+
outline none

themes/bootstrap3.styl

+15-71
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
@require 'base'
2+
13
.react-selectize.bootstrap3
24
color black
35
background-color white
46
font-family Helvetica Neue, Helvetica, Arial, sans-serif
5-
user-select none
6-
position relative
77

88
&:not(.tethered)
99
width 300px
1010

11-
&.disabled
12-
pointer-events none
13-
1411
&.open .react-selectize-control
1512
border 1px solid #66afe9
1613
box-shadow inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6)
@@ -19,94 +16,51 @@
1916
border 1px solid
2017
border-color #d9d9d9 #cccccc #b3b3b3
2118
border-radius 4px
22-
cursor pointer
2319
font-size 1em
24-
display flex
25-
align-items flex-start
26-
position relative
2720

2821
// this controls the height of the select
2922
> div
3023
min-height 30px
3124

3225
.react-selectize-placeholder
3326
color #aaa
34-
display flex
35-
align-items center
36-
overflow hidden
3727
text-indent 8px
38-
text-overflow ellipsis
39-
white-space nowrap
40-
position absolute
4128

4229
.react-selectize-selected-values
43-
display flex
44-
flex-grow 1
45-
flex-wrap wrap
4630
padding-left 5px
4731

48-
.resizable-input
49-
background none
50-
border none
51-
outline none
52-
font-size 1em
53-
margin 2px
54-
padding 4px 0px
55-
vertical-align middle
56-
width 0px
57-
58-
.value-wrapper
59-
display flex
60-
align-items center
61-
62-
.react-selectize-arrow-container, .react-selectize-reset-container
63-
flex-grow 0
64-
flex-shrink 0
65-
display flex
66-
align-items center
67-
justify-content center
68-
69-
.react-selectize-arrow-container
70-
width 32px
71-
72-
.react-selectize-reset-container
73-
width 16px
74-
7532
.react-selectize-reset-container:hover .react-selectize-reset path
7633
stroke #c0392b
7734

78-
.react-selectize-arrow path
79-
fill #999
80-
8135
.react-selectize-reset path
82-
transition all 0.5s 0s ease
83-
stroke #999
84-
stroke-linecap square
85-
stroke-linejoin mitter
86-
stroke-width 1px
87-
36+
transition stroke 0.5s 0s ease
8837

8938
// DROPDOWN MENU (in document.body when @props.tether is true)
9039
.react-selectize.dropdown-menu-container.bootstrap3
9140
font-family Helvetica Neue, Helvetica, Arial, sans-serif
92-
position absolute
9341
width 300px
9442

43+
&.flipped
44+
margin-bottom 5px
45+
46+
&:not(.flipped)
47+
margin-top 5px
48+
9549
.dropdown-menu
9650

97-
&.slide-enter-active, &.slide-leave-active
51+
&.custom-enter-active, &.custom-leave-active
9852
transition opacity 0.2s 0s ease
9953

100-
&.slide-enter
54+
&.custom-enter
10155
opacity 0
10256

103-
&.slide-enter-active
57+
&.custom-enter-active
10458
opacity 1
10559

106-
&.slide-leave
60+
&.custom-leave
10761
opacity 1
10862

109-
&.slide-leave-active
63+
&.custom-leave-active
11064
opacity 0
11165

11266
.react-selectize.dropdown-menu.bootstrap3
@@ -117,9 +71,6 @@
11771
box-shadow 0 6px 12px rgba(0, 0, 0, 0.175)
11872
font-family Helvetica Neue, Helvetica, Arial, sans-serif
11973
max-height 200px
120-
overflow auto
121-
position absolute
122-
z-index 10
12374

12475
&.tethered
12576
min-width 300px
@@ -140,12 +91,6 @@
14091
&.red
14192
color red !important
14293

143-
.groups.as-columns
144-
display flex
145-
146-
> div
147-
flex 1
148-
14994
.simple-group-title
15095
background-color #fafafa
15196
padding 8px 8px
@@ -200,5 +145,4 @@
200145
span
201146
cursor default
202147
display inline-block
203-
vertical-align top
204-
148+
vertical-align top

0 commit comments

Comments
 (0)