Skip to content

Commit 7b961b2

Browse files
committed
update CSS in ContributorsEditor
1 parent aaf1c83 commit 7b961b2

File tree

5 files changed

+74
-44
lines changed

5 files changed

+74
-44
lines changed

config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ module.exports = {
3636
// (https://github.com/webpack/css-loader#sourcemaps)
3737
// In our experience, they generally work as expected,
3838
// just be aware of this issue when enabling this option.
39-
cssSourceMap: false
39+
cssSourceMap: true
4040
}
4141
}

src/assets/sass/components/_buttons.scss

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,29 @@ $ico-line-w: $one-px;
1313
$ico-color: $button-icon-color;
1414
$diagonal-factor: 1.4142135624; // diagonal of a square 1x1 (1.4142135624 is a square root of 1*1+1*1)
1515

16-
@mixin button-plus( $size: $button-height, $line-w: 0.2rem, $rotate: 0, $plus:'true') {
17-
$plus-shift-x: ($button-height - $size)/2;
18-
$plus-shift-y: $button-height/2 - $line-w/2;
16+
@mixin plus( $size:$button-height, $line-w:$one-px, $rotate: 0deg, $plus:'true') {
17+
$plus-shift-x: -$size/2;
18+
$plus-shift-y: - $line-w/2;
19+
$deg: $rotate;// * 1deg;
1920

2021
&:before,
21-
&:after {
22-
content: '';
23-
display: block;
22+
&:after{
2423
width: $size;
2524
height: $size;
26-
position: absolute;
25+
border: none;
26+
top: 50%;
27+
left: 50%;
28+
transition: all 0.25s;
2729
}
2830
&:before {
2931
border-top: $line-w solid $button-icon-color;
30-
transform: translate($plus-shift-x, $plus-shift-y) rotate($rotate);
32+
transform: translate($plus-shift-x, $plus-shift-y) rotate($deg);
3133
transform-origin: top;
3234
}
3335
@if ($plus == 'true') {
3436
&:after {
3537
border-left: $line-w solid $button-icon-color;
36-
transform: translate($plus-shift-y, $plus-shift-x) rotate($rotate);
38+
transform: translate($plus-shift-y, $plus-shift-x) rotate($deg);
3739
transform-origin: left;
3840
}
3941
}
@@ -151,13 +153,16 @@ $diagonal-factor: 1.4142135624; // diagonal of a square 1x1 (1.4142135624 is a s
151153
}
152154

153155
@if $name == plus {
154-
@include button-plus($size, $line-w)
156+
@include plus($size, $line-w)
155157

156158
} @else if $name == plus-medium {
157-
@include button-plus(2rem, $one-px)
159+
@include plus($size, $one-px)
158160

159161
} @else if $name == minus {
160-
@include button-plus($size, $line-w, 0, 'false')
162+
@include plus($size, $line-w, 0deg, 'false');
163+
164+
} @else if $name == cancel {
165+
@include plus($size, $line-w, 45deg);
161166

162167
} @else if $name == up {
163168
@include button-arrow($size, $line-w)
@@ -166,9 +171,6 @@ $diagonal-factor: 1.4142135624; // diagonal of a square 1x1 (1.4142135624 is a s
166171
@include button-arrow($size, $line-w);
167172
transform: rotate(180deg);
168173

169-
} @else if $name == cancel {
170-
@include button-plus(2rem, 0.1rem, 45deg)
171-
172174
} @else if $name == drop-down {
173175
@include arrowhead(bottom, $size)
174176

src/assets/sass/components/_form.scss

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ $two-thirds: $module-size / 3 * 2;
9191

9292
.v-select.px {
9393
font-family: font-family-of($work-sans) !important;
94+
cursor: unset;
9495

9596
*{
9697
border-radius: 0!important;
@@ -99,19 +100,26 @@ $two-thirds: $module-size / 3 * 2;
99100
.dropdown-toggle{
100101
display: flex;
101102
flex-flow: column nowrap;
103+
104+
& > input{
105+
width: calc(100% - #{$two-thirds});
106+
height: $two-thirds;
107+
line-height: $two-thirds;
108+
}
102109
}
103110

104111
.open-indicator {
105112
@include button($w: $two-thirds, $h: $two-thirds);
106-
@include button-icon(drop-down, $module-size/4);
113+
@include button-icon(plus, $module-size/3);
107114

108115
position: absolute !important;
109-
right: 0 !important;
116+
left: 0 !important;
110117
bottom: 0 !important;
111118
pointer-events: all;
119+
cursor: pointer !important;
112120
}
113121
&.open .open-indicator{
114-
@include button-icon(drop-down-open, $module-size/4);
122+
@include button-icon(cancel, $module-size/3);
115123
}
116124

117125
.selected-tag{
@@ -121,7 +129,7 @@ $two-thirds: $module-size / 3 * 2;
121129
height: $two-thirds;
122130
line-height: $two-thirds;
123131
margin: 0;
124-
padding: 0 $module-size/4;
132+
padding: 0 $module-size/4 0 0;
125133
background: transparent;
126134

127135
.option:after{
@@ -130,13 +138,15 @@ $two-thirds: $module-size / 3 * 2;
130138
}
131139

132140
button{
141+
order: -1;
133142
display: inline-block;
134143
width: $two-thirds;
135144
height: $two-thirds;
136-
opacity: 1;
145+
opacity: 0.3;
137146
min-height: 0;
138147
min-width: 0;
139148
font-weight: 300;
149+
margin-right: $module-size/8;
140150

141151
&:before{
142152
content: none;
@@ -149,6 +159,15 @@ $two-thirds: $module-size / 3 * 2;
149159
input[type="search"]:focus,
150160
.selected-tag{
151161
min-height: auto;
162+
height: $two-thirds;
163+
}
164+
input[type="search"],
165+
input[type="search"]:focus,
166+
ul.dropdown-menu li{
167+
padding-left: $two-thirds + $module-size/8;
168+
a{
169+
padding-left:0;
170+
}
152171
}
153172

154173
.focused{
@@ -174,9 +193,11 @@ $two-thirds: $module-size / 3 * 2;
174193
}
175194
}
176195
.inline-select{
196+
$h: $module-size/2;
177197
font-size: $font-size-caption;
178-
height: 100%;
198+
height: $h;
179199
display: inline-block;
200+
margin-top: ($two-thirds - $h)/2;
180201
position: relative;
181202

182203
.dropdown-toggle{
@@ -185,38 +206,42 @@ $two-thirds: $module-size / 3 * 2;
185206

186207
input[type="search"],
187208
input[type="search"]:focus {
188-
line-height: $two-thirds;
189-
height: $two-thirds;
209+
line-height: $h;
210+
height: $h;
190211
background: $bg-color;
191212
width: 0!important;
213+
padding: 0;
192214
}
193215
}
194216
ul.dropdown-menu{
195217
padding: 0 0 0.5em 0!important;
196218
box-shadow: 0 0 0 1px #575757!important;
197-
li a {
198-
padding: 0.5em 1em;
219+
li {
220+
padding-left: 0 !important;
221+
a {
222+
padding: 0.5em 1em !important;
223+
}
199224
}
200225
}
201226
.selected-inline-tag{
202227
display: block;
228+
line-height: $h;
203229
pointer-events: none;
204230
cursor: pointer !important;
205231
padding: 0 $module-size/4;
206232
background: $bg-secondary-color;
207233

208-
button.close{
209-
}
210234
}
211-
212-
&.open{
235+
&.open {
236+
input[type="search"],
237+
input[type="search"]:focus {
238+
width: 100%;
239+
min-width: 10em;
240+
padding: $module-size/4;
241+
z-index: 3000;
242+
}
213243
.selected-inline-tag{
214244
display: none;
215245
}
216-
input[type="search"]{
217-
width: 100%!important;
218-
min-width: 12em;
219-
z-index: 3000;
220-
}
221246
}
222247
}

src/components/elements/ContributorsEditor.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
<!--
1212
TODO: interface for setting the Roles of contributors:
1313
here is an attempt to do so.. an extra inline select..-->
14-
<inline-select taggable
15-
v-model="option.role"
14+
<inline-select
1615
:options="roles"
17-
:pushTags="true"
18-
:placeholder="contributor"
19-
class="micro"/>
16+
:pushTags="true"/>
2017
</template>
2118
</v-select>
2219
</template>

src/components/elements/SelectInline.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@
3030
:class="[isValueEmpty ? 'empty' : 'has-value']"
3131
autocomplete="false"
3232
:disabled="disabled"
33-
:placeholder="searchPlaceholder"
33+
:placeholder="placeholderValue"
3434
:tabindex="tabindex"
3535
:readonly="!searchable"
3636
:id="inputId"
3737
aria-label="Search for option"
38-
value="AAAA"
3938
/>
4039

4140
<slot name="spinner">
@@ -75,10 +74,17 @@
7574
} else if (this.mutableValue) {
7675
return [this.mutableValue]
7776
}
78-
7977
return ['artist']
78+
},
79+
placeholderValue () {
80+
return this.mutableValue ? this.mutableValue : 'artist'
81+
},
82+
searchPlaceholder () {
83+
// if (this.isValueEmpty && this.placeholder) {
84+
// return 'AAAA'// this.mutableValue
85+
// }
8086
}/* ,
81-
dropdownOpen () { return true } */
87+
dropdownOpen () { return false }/**/
8288
}
8389
}
8490
</script>

0 commit comments

Comments
 (0)