Skip to content

Commit 307092a

Browse files
authored
Pro 5929 fix stylelint (#4551)
* install and use stylelint-config-apostrophe instead of specific config * fix all lint errors
1 parent 1959ef0 commit 307092a

File tree

113 files changed

+890
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+890
-553
lines changed

.stylelintrc

+1-93
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,3 @@
11
{
2-
plugins: [
3-
'stylelint-order',
4-
'stylelint-declaration-strict-value'
5-
],
6-
rules: {
7-
'color-hex-length': 'short',
8-
'color-named': 'never',
9-
'color-no-invalid-hex': true,
10-
'declaration-property-unit-allowed-list': { 'line-height': [] },
11-
'font-family-no-duplicate-names': true,
12-
'number-leading-zero': 'always',
13-
'number-max-precision': 2,
14-
'number-no-trailing-zeros': true,
15-
'string-no-newline': true,
16-
'length-zero-no-unit': true,
17-
'unit-case': 'lower',
18-
'unit-no-unknown': true,
19-
'value-keyword-case': 'lower',
20-
'value-list-comma-newline-after': 'always-multi-line',
21-
'value-list-comma-space-after': 'always-single-line',
22-
'value-list-comma-space-before': 'never',
23-
'value-list-max-empty-lines': 0,
24-
'shorthand-property-no-redundant-values': true,
25-
'property-case': 'lower',
26-
'property-no-unknown': true,
27-
'property-no-vendor-prefix': true,
28-
'declaration-no-important': true,
29-
'declaration-colon-space-after': 'always-single-line',
30-
'declaration-colon-space-before': 'never',
31-
'declaration-block-no-duplicate-properties': true,
32-
'declaration-block-no-redundant-longhand-properties': true,
33-
'declaration-block-no-shorthand-property-overrides': true,
34-
'declaration-block-semicolon-newline-after': 'always',
35-
'declaration-block-semicolon-newline-before': 'never-multi-line',
36-
'declaration-block-single-line-max-declarations': 1,
37-
'declaration-block-trailing-semicolon': 'always',
38-
'block-closing-brace-empty-line-before': 'never',
39-
'block-closing-brace-newline-after': [
40-
'always',
41-
{ ignoreAtRules: ['if', 'else'] }
42-
],
43-
'block-closing-brace-newline-before': 'always-multi-line',
44-
'block-no-empty': true,
45-
indentation: 2,
46-
'max-empty-lines': 1,
47-
'max-nesting-depth': 2,
48-
'selector-list-comma-newline-after': 'always-multi-line',
49-
'string-quotes': 'single',
50-
'time-min-milliseconds': 150,
51-
'order/order': ['declarations', 'rules'],
52-
'order/properties-order': [
53-
'z-index',
54-
'position',
55-
'top',
56-
'right',
57-
'bottom',
58-
'left',
59-
'display',
60-
'overflow',
61-
'width',
62-
'height',
63-
'margin',
64-
'padding',
65-
'border',
66-
'color',
67-
'background',
68-
'font-family',
69-
'font-size',
70-
'text-align'
71-
],
72-
'scale-unlimited/declaration-strict-value': [
73-
['/color/', 'font', 'font-family', 'font-size', 'z-index'],
74-
{
75-
ignoreKeywords: [
76-
'currentColor',
77-
'inherit',
78-
'initial',
79-
'transparent',
80-
'auto'
81-
]
82-
}
83-
]
84-
},
85-
overrides: [
86-
{
87-
files: ['**/*.scss'],
88-
customSyntax: 'postcss-scss'
89-
},
90-
{
91-
files: ['**/*.vue'],
92-
customSyntax: 'postcss-html'
93-
}
94-
]
2+
"extends": "stylelint-config-apostrophe"
953
}

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
### Adds
66

7-
* Adds pinia and a store to handle modals logic. Methods from the store are registered on `apos.modal` instead of component methods.
7+
* Adds a pinia store to handle modals logic.
8+
* Methods from the store are registered on `apos.modal` instead of methods from `TheAposModals` component.
9+
* No more need to emit `safe-close` when defining an `AposModal`, modal is automatically resolved when closed.
810

911
### Changes
1012

@@ -16,6 +18,7 @@ Page A and page B are siblings.
1618
Page A has the slug `/peer` and page B has the slug `/peer/page`.
1719
Now we want page B to be the child of page A.
1820
We will now end up with page B slug as `/peer/page` and not `/peer/peer/page` as before.
21+
* Fixes stylelint config file, uses config from our shared configuration, fixes all lint errors.
1922

2023
### Adds
2124

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBar.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default {
100100
101101
:deep(.apos-admin-bar__control-set) {
102102
@include type-base;
103+
103104
display: flex;
104105
width: 100%;
105106
height: 100%;
@@ -112,25 +113,30 @@ export default {
112113
:deep(.apos-context-menu__pane) {
113114
min-width: 150px;
114115
}
116+
115117
:deep(.flip-enter) { // to the ground
116118
transform: translateY(-20%);
117119
opacity: 0;
118120
}
121+
119122
:deep(.flip-leave) { // in the frame
120123
transform: translateY(0);
121124
opacity: 1;
122125
}
126+
123127
:deep(.flip-enter-to) { // from the ground
124128
transform: translateY(0);
125129
opacity: 1;
126130
}
131+
127132
:deep(.flip-leave-to) { // to the sky
128133
transform: translateY(20%);
129134
opacity: 0;
130135
}
131136
132137
:deep(.flip-enter-active), :deep(.flip-leave-active) {
133-
transition: all 150ms;
138+
transition: all 200ms;
139+
134140
&.apos-admin-bar__control-set__group {
135141
position: absolute;
136142
}

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarLocale.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ export default {
192192
.apos-admin-locales {
193193
position: relative;
194194
margin-right: $spacing-base;
195-
padding-left: $spacing-base;
196195
padding-right: $spacing-base;
196+
padding-left: $spacing-base;
197+
197198
&::before,
198199
&::after {
199200
content: '';
@@ -214,6 +215,7 @@ export default {
214215
215216
&:deep(.apos-button__label) {
216217
@include type-small;
218+
217219
color: var(--a-primary);
218220
font-weight: var(--a-weight-bold);
219221
letter-spacing: 1px;
@@ -226,6 +228,7 @@ export default {
226228
227229
.apos-locales-filter {
228230
@include type-large;
231+
229232
box-sizing: border-box;
230233
width: 100%;
231234
padding: 20px 45px 20px 20px;
@@ -248,11 +251,11 @@ export default {
248251
}
249252
250253
.apos-locales {
254+
margin: $spacing-base 0;
255+
padding-left: 0;
251256
list-style-type: none;
252257
max-height: 350px;
253258
overflow-y: scroll;
254-
padding-left: 0;
255-
margin: $spacing-base 0;
256259
font-weight: var(--a-weight-base);
257260
}
258261

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarUser.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ export default {
5656
5757
:deep(.apos-button) {
5858
@include type-base;
59+
5960
color: var(--a-text-primary);
6061
}
6162
6263
:deep(.apos-context-menu__popup) {
6364
right: 0;
64-
transform: translatex(10px);
65+
transform: translateX(10px);
6566
}
6667
}
6768

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextModeAndSettings.vue

+1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export default {
187187
<style lang="scss" scoped>
188188
.apos-admin-bar__control-set--mode-and-settings {
189189
justify-content: flex-end;
190+
190191
&:deep(.apos-button) {
191192
margin-left: 4px;
192193
}

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextTitle.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ export default {
148148
</script>
149149
<style lang="scss" scoped>
150150
.apos-admin-bar__control-set--title {
151-
justify-content: center;
152151
align-items: center;
152+
justify-content: center;
153153
}
154+
154155
.apos-admin-bar__title {
155156
display: inline-flex;
156157
align-items: center;
@@ -169,8 +170,8 @@ export default {
169170
170171
&__separator {
171172
align-items: center;
172-
padding: 0 7px;
173173
margin-top: 1px;
174+
padding: 0 7px;
174175
}
175176
176177
&__document {

modules/@apostrophecms/admin-bar/ui/apos/components/TheAposSavingIndicator.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,17 @@ export default {
121121
<style lang="scss" scoped>
122122
.apos-admin-bar__status {
123123
@include type-help;
124+
124125
position: relative;
125126
margin-left: 7.5px;
126127
opacity: 1;
127128
color: var(--a-base-2);
128-
transition: opacity 150ms;
129+
transition: opacity 200ms;
130+
129131
&.apos-is-hidden {
130132
opacity: 0;
131133
}
134+
132135
.apos-is-success {
133136
color: var(--a-success);
134137
}
@@ -148,14 +151,15 @@ export default {
148151
}
149152
150153
.apos-admin-bar__status__icon {
151-
margin-right: 7.5px;
152154
width: 18px;
153155
height: 18px;
156+
margin-right: 7.5px;
154157
}
155158
156159
.apos-admin-bar__status__label {
157160
opacity: 1;
158161
transition: opacity 200ms ease;
162+
159163
&.apos-is-hidden {
160164
opacity: 0;
161165
}

modules/@apostrophecms/area/ui/apos/components/AposAreaContextualMenu.vue

+13-7
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ export default {
294294
.apos-area-menu__button {
295295
@include apos-button-reset();
296296
@include type-base;
297+
297298
box-sizing: border-box;
298299
width: 100%;
299300
padding: 5px 20px;
@@ -329,11 +330,13 @@ export default {
329330
330331
.apos-area-menu__group-label {
331332
@include apos-button-reset();
332-
box-sizing: border-box;
333+
333334
display: flex;
334-
width: 100%;
335+
box-sizing: border-box;
335336
justify-content: space-between;
337+
width: 100%;
336338
padding: 10px 20px;
339+
337340
&:hover {
338341
cursor: pointer;
339342
}
@@ -346,6 +349,7 @@ export default {
346349
347350
.apos-area-menu__group-chevron {
348351
@include apos-transition();
352+
349353
transform: rotate(90deg);
350354
}
351355
@@ -354,23 +358,25 @@ export default {
354358
}
355359
356360
.apos-area-menu__group {
357-
border-bottom: 1px solid var(--a-base-8);
358-
padding-bottom: 10px;
359361
margin: 10px 0;
362+
padding-bottom: 10px;
363+
border-bottom: 1px solid var(--a-base-8);
360364
}
365+
361366
.apos-area-menu__item:last-child.apos-has-group .apos-area-menu__group {
362-
border-bottom: none;
363367
margin-bottom: 0;
368+
border-bottom: none;
364369
}
365370
366371
.apos-area-menu__items--accordion {
372+
@include apos-transition($duration:0.3s);
373+
367374
overflow: hidden;
368375
max-height: 0;
369-
@include apos-transition($duration:0.3s);
370376
}
371377
372378
.apos-area-menu__items--accordion.apos-is-active {
373-
transition-delay: 0.25s;
379+
transition-delay: 250ms;
374380
max-height: 20rem;
375381
}
376382

modules/@apostrophecms/area/ui/apos/components/AposAreaEditor.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,13 @@ function cancelRefresh(refreshOptions) {
621621
<style lang="scss" scoped>
622622
.apos-empty-area {
623623
display: flex;
624-
padding: 30px;
625-
justify-content: center;
626-
align-items: center;
627624
flex-direction: column;
625+
align-items: center;
626+
justify-content: center;
627+
padding: 30px;
628+
border: 1px solid var(--a-base-8);
628629
min-height: 50px;
629630
background-color: var(--a-base-9);
630-
border: 1px solid var(--a-base-8);
631631
border-radius: var(--a-border-radius);
632632
}
633633

0 commit comments

Comments
 (0)