Skip to content

Commit f8fbdf8

Browse files
committed
Simplify SCSS
1 parent 70f03b4 commit f8fbdf8

File tree

3 files changed

+24
-37
lines changed

3 files changed

+24
-37
lines changed

core/src/main/resources/hudson/model/View/newJob.jelly

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ THE SOFTWARE.
4242

4343
<form method="post" action="createItem" name="createItem" id="createItem">
4444
<div class="header">
45-
<div class="jenkins-form-item jenkins-!-margin-bottom-0 add-item-name">
45+
<div class="jenkins-form-item add-item-name">
4646
<label for="name" class="jenkins-form-label">${%ItemName.label}</label>
4747
<input name="name" class="jenkins-input" id="name" data-valid="false" type="text" tabindex="0" />
4848
<div class="validation-error-area" />
4949
</div>
5050
</div>
5151

5252
<fieldset class="jenkins-!-display-contents">
53-
<div>
53+
<div class="jenkins-form-item">
5454
<legend class="jenkins-form-label">${%ItemType.label}</legend>
5555
<div id="items" class="jenkins-choice-list categories" data-valid="false">
5656
<template id="insertion-point">
@@ -70,7 +70,7 @@ THE SOFTWARE.
7070
<div class="jenkins-choice-list__item__description">${%CopyOption.description}</div>
7171
</label>
7272

73-
<div class="categoryexport">
73+
<div class="jenkins-choice-list__item__conditional">
7474
<j:set var="descriptor" value="${it.descriptor}" />
7575
<s:textbox id="from" data-valid="false" name="from" placeholder="${%CopyOption.placeholder}" field="copyNewItemFrom"/>
7676
</div>

src/main/js/add-item.scss

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,18 @@
22
max-width: 750px;
33
margin: auto;
44

5-
form {
6-
display: flex;
7-
flex-direction: column;
8-
gap: var(--section-padding);
9-
10-
#bottom-sticker {
11-
margin-top: calc(var(--section-padding) * -1);
12-
}
13-
}
14-
15-
.categories {
16-
.jenkins-choice-list__item {
17-
.categoryexport {
18-
display: none;
19-
margin-left: 4rem;
20-
margin-top: -0.25rem;
21-
margin-bottom: 0.875rem;
22-
}
23-
24-
// Default icons' text placeholder don't appear unless z-index is set
25-
.jenkins-choice-list__item__icon {
26-
span {
27-
z-index: 1;
28-
}
29-
}
30-
31-
&:has(input:checked) {
32-
.categoryexport {
33-
display: block;
34-
}
5+
.jenkins-choice-list__item {
6+
// Default icons' text placeholder don't appear unless z-index is set
7+
.jenkins-choice-list__item__icon {
8+
span {
9+
z-index: 1;
3510
}
11+
}
3612

37-
input {
38-
width: 100%;
39-
max-width: 400px;
40-
}
13+
// Make 'Duplicate an existing item' input not full width
14+
input {
15+
width: 100%;
16+
max-width: 400px;
4117
}
4218
}
4319
}

src/main/scss/components/_choice-list.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
inset 0 0 18px 18px var(--accent-color);
114114
}
115115
}
116+
117+
.jenkins-choice-list__item__conditional {
118+
display: block;
119+
}
116120
}
117121

118122
&:first-of-type {
@@ -191,5 +195,12 @@
191195
grid-column: 2;
192196
padding-right: 2rem;
193197
}
198+
199+
&__conditional {
200+
display: none;
201+
margin-left: 4rem;
202+
margin-top: -0.25rem;
203+
margin-bottom: 0.875rem;
204+
}
194205
}
195206
}

0 commit comments

Comments
 (0)