Projet

Général

Profil

0001-armentieres-create-theme.patch

Corentin Séchet, 29 août 2022 09:48

Télécharger (17 ko)

Voir les différences:

Subject: [PATCH] armentieres: create theme

 static/armentieres/_custom.scss               | 640 ++++++++++++++++++
 static/armentieres/_vars.scss                 |  98 +++
 static/armentieres/config.json                |  24 +
 static/armentieres/style.scss                 |   5 +
 .../armentieres/combo/page_template.html      |  15 +
 templates/variants/armentieres/theme.html     |  11 +
 templates/variants/armentieres/wcs/base.html  |  14 +
 7 files changed, 807 insertions(+)
 create mode 100644 static/armentieres/_custom.scss
 create mode 100644 static/armentieres/_vars.scss
 create mode 100644 static/armentieres/config.json
 create mode 100644 static/armentieres/style.scss
 create mode 100644 templates/variants/armentieres/combo/page_template.html
 create mode 100644 templates/variants/armentieres/theme.html
 create mode 100644 templates/variants/armentieres/wcs/base.html
static/armentieres/_custom.scss
1
//
2
// Typo
3
//
4
h1 {
5
	font-size: $fz-1;
6
}
7

  
8
h2 {
9
	font-size: $fz-2;
10
}
11

  
12
h3 {
13
	font-size: $fz-3;
14
}
15

  
16
//
17
// Header
18
//
19
div#top {
20
	display: flex;
21
	align-items: center;
22
	flex-wrap: wrap;
23
	padding-top: 0.5rem;
24
}
25

  
26
#logo{
27
	@media($max-mobile-viewport) {
28
		padding-left: 0;
29
	}
30
}
31

  
32
nav.site-nav {
33
	flex-grow: 1;
34
	@media($max-mobile-viewport) {
35
		position: absolute;
36
		top: 75px;
37
		right: 10px;
38
	}
39
}
40

  
41
div.gru-nav > ul {
42
	margin: 0;
43
	@media($max-mobile-viewport) {
44
		position: fixed;
45
		top: 0;
46
		right: 0;
47
		z-index: 10;
48
	}
49

  
50
	li a {
51
		font-weight: normal;
52
		padding: 30px 20px;
53
	}
54
}
55

  
56
div#header {
57
	max-width: calc(#{$width} + 100px);
58
}
59

  
60
div#toplinks {
61
	position: static;
62
	padding-top: 1rem;
63
	padding-bottom: 1rem;
64
	padding-right: 2rem;
65
	@media($max-mobile-viewport) {
66
		flex-grow: 1;
67
		padding-right: 50px;
68
	}
69

  
70
	.logged-in, .login {
71
		display: flex;
72
		flex-wrap: wrap;
73

  
74
		@media($max-mobile-viewport) {
75
			span {
76
				display: flex;
77
				a:first-child {
78
					flex-grow: 1;
79
				}
80
			}
81
		}
82

  
83
		> * {
84
			margin: 0 .3rem;
85
		}
86

  
87
		a {
88
			color: black;
89
			font-weight: bold;
90
			display: flex;
91
			align-items: center;
92
		}
93

  
94
		&::before {
95
			font-family: FontAwesome;
96
			content: '';
97
			width: 1.5rem;
98
			height: 1.5rem;
99
			background: url('/assets/profile:icon');
100
			margin-right: 0.5rem;
101
		}
102
	}
103
}
104

  
105
.arm-page-header {
106
	background: url('/assets/page-header:background');
107
	background-size: cover;
108
	background-position: center;
109
	color: white;
110

  
111
	h1 {
112
		font-size: 48em / $base-font;
113
	}
114

  
115
	&--default {
116
		display: none;
117
	}
118

  
119
	&--content {
120
		max-width: $width;
121
		clear: both;
122
		margin: 0 auto;
123
		.cell {
124
			padding: 3rem 0rem;
125
		}
126
	}
127

  
128
	@media ($max-mobile-viewport) {
129
		display: none;
130
	}
131
}
132

  
133
//
134
// Content
135
//
136
div#main-content-wrapper {
137
	max-width: none;
138
}
139

  
140
.central-content {
141
	max-width: $width;
142
	clear: both;
143
	margin: 0 auto;
144
}
145

  
146
@media ($min-desktop-viewport) {
147
	.gru-content {
148
		padding: 3rem 0.5rem 0 0.5rem;
149
	}
150
}
151

  
152
div#sidebar {
153
	div.cell h2:first-child {
154
		display: flex;
155
		align-items: center;
156
		&::after {
157
			content: '';
158
			background: $gray-light;
159
			flex-grow: 1;
160
			height: 1px;
161
			margin-left: 8px;
162
		}
163
	}
164

  
165
	@media($max-mobile-viewport) {
166
		display: none;
167
	}
168
}
169

  
170
.errornotice, .warningnotice, .successnotice, .infonotice {
171
	border-radius: $border-radius;
172
	padding-top: 2rem;
173
	padding-bottom: 2rem;
174
	padding-right: 2rem;
175

  
176
	a {
177
		color: $red;
178
	}
179

  
180
	&::before {
181
		top: calc(50% - 1rem);
182
	}
183
}
184

  
185
.errornotice::before {
186
	color: $red;
187
}
188

  
189
.warningnotice::before, .infonotice::before {
190
	color: $yellow;
191
}
192

  
193
.successnotice::before {
194
	color: $green-dark;
195
}
196

  
197
//
198
// Footer
199
//
200
#footer-wrapper {
201
	padding: 3rem 1.5rem 0;
202
	#footer {
203
		position: relative;
204
	}
205

  
206
	.back-top {
207
		position: absolute;
208
		top: -4.5rem;
209
		right: 0rem;
210
		background: $primary-color;
211
		border-radius: $border-radius;
212
		padding: 0.5rem;
213

  
214
		&--link {
215
			color: black;
216

  
217
			&:hover {
218
				text-decoration: none;
219
			}
220

  
221
			&::before {
222
				font-size: 1.8rem;
223
			}
224
		}
225

  
226
		&--link-label {
227
			display: none;
228
		}
229

  
230

  
231
	}
232

  
233
}
234

  
235
.arm-footer-bottom {
236
	padding: 1rem;
237
	background: $gray;
238
	color: white;
239
	.menu-cell {
240
		text-align: center;
241
		li {
242
			display: inline-block;
243
			border: none;
244
			a {
245
				border-radius: 0;
246
				border: none;
247
				color: white;
248
				padding: 0.5rem 2rem;
249
				&:hover {
250
					color: white;
251
				}
252
			}
253
		}
254
	}
255
}
256

  
257
//
258
// Cells
259
//
260
%title {
261
	margin-top: 1rem;
262
	margin-bottom: 1rem;
263
}
264

  
265
%cell-links-list {
266
	> li > a:hover {
267
		text-decoration: underline;
268
	}
269
}
270

  
271
div#rub_service div.category,
272
div#services > ul > li,
273
div#account-management,
274
#columns div.cell:not(.pk-button,.pk-big-button) div.links-list,
275
#columns div.menucell,
276
div.wcsformcell,
277
div.wcsformsofcategorycell,
278
div.wcscurrentdraftscell,
279
div.wcscurrentformscell {
280
	 ul > li {
281
		margin: 0.5rem;
282
		border: 1px solid $gray-light;
283
		border-radius: $border-radius;
284
		padding: 0rem 0.8rem;
285
		a {
286
			text-decoration: none;
287
		}
288

  
289
		&:hover {
290
			box-shadow: $widget-focus-box-shadow;
291
		}
292

  
293
		&.required-authentication, &.external-link {
294
			a{
295
				padding-right: 2rem;
296

  
297
				&::after {
298
					content: '';
299
					height: 1.3rem;
300
					width: 1.3rem;
301
					position: absolute;
302
					right: 0.7rem;
303
				}
304
			}
305
		}
306

  
307
		&.required-authentication a::after {
308
			background: center / contain no-repeat url('/assets/authentication-required:icon');
309
		}
310

  
311
		&.external-link a::after {
312
			background: center / contain no-repeat url('/assets/external-link:icon');
313
		}
314

  
315
		&:not(:last-child) {
316
			border-bottom: 1px solid $gray-light;
317
		}
318
	}
319
}
320

  
321
.gru-content div.cell {
322
	h2:first-child:not(:only-child) {
323
		border-bottom-left-radius: $border-radius;
324
		border-bottom-right-radius: $border-radius;
325
	}
326

  
327
	&.foldable > div > h2:first-child {
328
		background: $yellow;
329
		border: $yellow solid $gray;
330
		color: black;
331
		display: flex;
332
		font-size: $fz-3;
333
		align-items: center;
334
		height: 4rem;
335
		margin: 0;
336
		padding-left: 1rem;
337
		text-transform: none;
338

  
339
		&:hover {
340
			box-shadow: $widget-focus-box-shadow;
341
		}
342
	}
343

  
344
	&.folded > div > h2:first-child {
345
		border: 1px solid $gray;
346
		background: transparent;
347

  
348
		&::after {
349
			color: $gray;
350
		}
351
	}
352

  
353
	&.has-asset-picture {
354
		position: relative;
355

  
356
		> div > h2:first-child {
357
			padding-left: 6rem;
358
		}
359

  
360
		picture {
361
			height: 3rem;
362
			left: 1.5rem;
363
			position: absolute;
364
			top: 0rem;
365
			width: 3rem;
366
		}
367
	}
368
}
369

  
370
.gru-content div.searchcell form {
371
	padding: 0;
372
	input[type="search"] {
373
		background: $gray-xlight;
374
		border: none;
375

  
376
		&:focus {
377
			background: $gray-xlight;
378
			border: none;
379
		}
380
	}
381

  
382
	.combo-search--button {
383
		width: 100%;
384
	}
385
}
386

  
387
.gru-content div.tracking-code-input-cell {
388
	background: right / cover url('/assets/tracking-code-input:background');
389
	div.wcs-tracking-code-input {
390
		padding: 1rem;
391
		div {
392
			padding: 0;
393

  
394
			form {
395
				display: flex;
396
				flex-wrap: wrap;
397
				input {
398
					flex-grow: 99999;
399
					width: 11rem;
400
				}
401
				button {
402
					flex-grow: 1;
403
					@extend %black-button;
404
					margin-right: 0;
405
					min-width: 10rem;
406

  
407
					&, &:hover {
408
						color: $primary-color;
409
					}
410
				}
411
			}
412
		}
413
	}
414

  
415
	h2:first-child {
416
		color: black;
417
		background: transparent;
418
		font-size: $fz-3;
419
		margin-bottom: 0.5rem;
420
	}
421

  
422
}
423

  
424
/// WCS
425
.arm-form-header {
426
	background: $gray-xlight;
427

  
428
	&--content {
429
		max-width: $width;
430
		margin: 0 auto;
431
		padding: 1.5rem 0 2.5rem 0;
432
	}
433

  
434
	&--title {
435
		margin: 0;
436
		font-weight: 900;
437
		max-width: 35rem;
438
		text-transform: uppercase;
439
		font-size: 48em / $base-font;
440
	}
441

  
442
	@media($max-mobile-viewport) {
443
		&--content {
444
			padding: 1rem 0 1rem 0;
445
		}
446

  
447
		&--title {
448
			font-size: $fz-1;
449
			text-align: center;
450
		}
451
	}
452
}
453

  
454
div#tracking-code {
455
	padding: 1rem;
456
	background: right / cover url('/assets/tracking-code:background');
457
	border-radius: $border-radius;
458
	.tracking-code-part {
459
		display: flex;
460
		flex-direction: column;
461
		h3 {
462
			background: transparent;
463
			color: black;
464
			text-transform: none;
465
			text-align: center;
466
			margin-bottom: 0.7rem;
467
		}
468
		a {
469
			text-align:center;
470
			background: white;
471
			padding: 0.5rem;
472
			border-radius: $border-radius;
473
			font-weight: bold;
474
		}
475
	}
476

  
477
	form[action="removedraft"] {
478
		display: flex;
479
		justify-content: center;
480
		.form-discard-draft {
481
			@extend %black-button;
482
			margin-right: 0;
483
			&, &:hover {
484
				color: $primary-color;
485
			}
486
		}
487
	}
488
}
489

  
490
%button {
491
	box-shadow: none;
492
	padding: 0.5rem 1.5rem;
493
}
494

  
495
%black-button {
496
	@extend %button;
497
	background: black;
498
	&:hover {
499
		background: black;
500
	}
501
}
502

  
503
%gray-button {
504
	background: $gray-xlight;
505
	color: black;
506
	&:hover {
507
		background: $gray-xlight;
508
	}
509
}
510

  
511
.wcs-step {
512
	border-radius: 0;
513
	align-items: center;
514
	&.current {
515
		font-weight: normal;
516
	}
517

  
518
	&--marker-nb {
519
		font-weight: bold;
520
	}
521

  
522
	@media($min-desktop-viewport) {
523
		&.step-before::after {
524
			content: '\f00c';
525
			font-family: FontAwesome;
526
			margin: 0rem 1rem;
527
			color: $green;
528
		}
529
	}
530
}
531

  
532
.field {
533
	&--label .required {
534
		margin: 0;
535
		color: $primary-color;
536
	}
537
}
538

  
539
input[type=radio], input[type=checkbox] {
540
	&:focus {
541
		box-shadow: none;
542
	}
543
}
544

  
545
input[readonly], select[readonly], textarea[readonly] {
546
	border-radius: $widget-border-radius;
547
	background: transparent;
548
	border: $widget-border;
549
}
550

  
551
input::placeholder {
552
	font-style: italic;
553
}
554

  
555
@mixin form-button-left($symbol) {
556
	&::before {
557
		content: $symbol;
558
		font-family: FontAwesome;
559
		font-size: 0.7rem;
560
		margin-right: 1rem;
561
	}
562
}
563

  
564
@mixin form-button-right($symbol) {
565
	&::after {
566
		content: $symbol;
567
		font-family: FontAwesome;
568
		font-size: 0.7rem;
569
		margin-left: 1rem;
570
	}
571
}
572

  
573
.form-content {
574
	&--body .buttons.submit {
575
		.form-next{
576
			@include form-button-right('\f054');
577
		}
578

  
579
		.form-previous {
580
			@include form-button-left('\f053');
581
		}
582

  
583
		.form-submit {
584
			@include form-button-left('\f00c');
585
		}
586

  
587
		.form-discard, .cancel {
588
			@include form-button-left('\f00d');
589
		}
590
	}
591
}
592

  
593
div.form-validation div.page {
594
	border-radius: $border-radius;
595
}
596

  
597
.back-home-button {
598
	display: flex;
599
	justify-content: center;
600
	a {
601
		@extend %button;
602
		&::after {
603
			content: '\f0e2';
604
			font-family: FontAwesome;
605
			margin-left: 1rem;
606
		}
607
	}
608
}
609

  
610
///
611
/// Custom classes
612
///
613
.arm-salmon {
614
	color: $salmon;
615
}
616

  
617
@mixin custom-background-cell($background, $button-color) {
618
	border: 1px solid transparent;
619
	background: right / cover no-repeat url($background);
620
	.pk-button, .pk-big-button {
621
		@extend %black-button;
622
		&, &:hover {
623
			color: $button-color;
624
		}
625
	}
626
}
627

  
628
.gru-content .cell {
629
	&.arm-report {
630
		@include custom-background-cell('/assets/report:background', $secondary-color)
631
	}
632

  
633
	&.arm-suggest {
634
		@include custom-background-cell('/assets/suggest:background', $primary-color)
635
	}
636

  
637
	&.arm-register {
638
		@include custom-background-cell('/assets/register:background', $primary-color)
639
	}
640
}
static/armentieres/_vars.scss
1
$gray-xlight: #f2f2f2;
2
$gray-light: #cccccc;
3
$gray: #919191;
4
$gray-dark: #333333;
5
$salmon: #ec8771;
6
$yellow: #ecbe54;
7
$yellow-light: #fdf4da;
8
$red: #e95f5c;
9
$red-light: #fae1db;
10
$green-dark: #557c40;
11
$green: #9ecf87;
12
$green-light: #e6efdf;
13

  
14
$primary-color: $salmon;
15
$secondary-color: $yellow;
16

  
17

  
18
/// Typo
19
$font-family: Lato, sans-serif;
20
$link-color: $primary-color;
21
$link-decoration: none;
22
$link-hover-decoration: underline;
23

  
24
$base-font: 16;
25
$fz-1: 30em / $base-font;
26
$fz-2: 20em / $base-font;
27
$fz-3: 18em / $base-font;
28
$fz-4: 14em / $base-font;
29
$fz-small: 14em / $base-font;
30
$fz-xsmall: 11em / $base-font;
31

  
32
$font-size: 100% / ( 15 / $base-font );
33

  
34
// General
35
$border-radius: 5px;
36
$notification_error_color: $red-light;
37
$notification_warning_color: $yellow-light;
38
$notification_success_color: $green-light;
39
$notification_info_color: $yellow-light;
40
$sidebar-columns-gutter: 50px;
41
$back-top-display: block;
42
$back-top-icon-character: "\f062";
43

  
44
// Header
45
$header-logo-size: 250px 60px;
46
$toplinks-style: none;
47
$sidebar-width: 30%;
48
$nav-after-image: false;
49

  
50
$nav-color: $gray;
51
$nav-item-hover-background: transparent;
52
$nav-item-selected-mode: bottom-border;
53
$nav-item-selected-border: $primary-color 3px solid;
54
$nav-item-hover-border: $primary-color 3px solid;
55
$nav-button-background: transparent;
56
$nav-button-color: $primary-color;
57
$nav-border-color: transparent;
58
$nav-mobile-menu-item-hover-color: black;
59
$nav-button-bar-height: 3px;
60
$nav-mobile-bottom-bar-item-hover-color: black;
61
$nav-mobile-bottom-bar-item-selected-background: $primary-color;
62
$nav-mobile-bottom-bar-item-selected-color: black;
63

  
64
// Title
65
$title-padding: 0;
66
$title-color: $primary-color;
67
$title-font-size: $fz-2;
68
$title-transform: uppercase;
69
$title-weight: 700;
70
$title-background: transparent;
71

  
72
// Cells
73
$cell-border: none;
74
$cell-entry-color: black;
75
$cell-entry-hover-color: black;
76
$cell-entry-font-weight: normal;
77
$cell-entry-hover-background: transparent;
78
$cell-entry-border: none;
79

  
80
$widget-focus-box-shadow: 0 0 5px 2px $gray-light;
81

  
82
// Footer
83
$footer-background: $gray-dark;
84

  
85
// WCS
86
$wcs-step-current-label-color: black;
87
$wcs-step-color: $gray;
88
$wcs-step-border-bottom: 1px solid $gray-light;
89
$wcs-step-current-border-bottom: 2px solid $gray-light;
90
$form-sidebar-width: 25%;
91
$form-sidebar-gutter: 3rem;
92

  
93
$form-accent-color: $primary-color;
94
$widget-border-radius: $border-radius;
95
$button-color: black;
96
$button-background: $secondary-color;
97
$buttons-order: previous (grow), cancel (grow), submit;
98
$cancel-button-style: "%gray-button";
static/armentieres/config.json
1
{
2
  "label": "Armentières",
3
  "variables": {
4
    "theme_color": "#e8735f",
5
    "email_header_asset": "emails:logo"
6
  },
7
  "settings": {
8
    "combo": {
9
      "COMBO_ASSET_SLOTS.update": {
10
        "authentication-required:icon": { "label": "Authentification nécessaire: Icône" },
11
        "emails:logo": { "label": "Emails : logo" },
12
        "external-link:icon": { "label": "Lien externe: Icône" },
13
        "header:logo": { "label": "Têtière : logo" },
14
        "page-header:background": { "label": "En-tête de page : fond" },
15
        "profile:icon": { "label": "Profil : Icône" },
16
        "register:background": { "label": "S'enregistrer: Fond" },
17
        "report:background": { "label": "Signaler une anomalie: Fond" },
18
        "suggest:background": { "label": "Suggérer une démarche: Fond" },
19
        "tracking-code-input:background": { "label": "Entrée du code de suivi: fond" },
20
        "tracking-code:background": { "label": "Code de suivi: Fond" }
21
      }
22
    }
23
  }
24
}
static/armentieres/style.scss
1
@charset "UTF-8";
2

  
3
@import 'vars';
4
@import '../includes/publik';
5
@import 'custom';
templates/variants/armentieres/combo/page_template.html
1
{% extends "combo/page_template.html" %}
2

  
3
{% block content-pre %}
4
	<header class="arm-page-header">
5
		<div class="arm-page-header--content">{% placeholder "page-header" name="En-tête de la page"%}</div>
6
	</header>
7
	{%skeleton_extra_placeholder after-header %}
8
	{% end_skeleton_extra_placeholder %}
9
{% endblock %}
10

  
11
{% block footer-post %}
12
  <div class="arm-footer-bottom">
13
	{% placeholder "footer-bottom" name="Bas du pied de page" acquired=True optional=True %}
14
  </div>
15
{% endblock %}
templates/variants/armentieres/theme.html
1
{% extends 'theme.html' %}
2

  
3
{# move nav #}
4
{% block header-content %}
5
  {% block nav %}{% endblock %}
6
  {% block top-links %}{% endblock %}
7
{% endblock %}
8

  
9
{% block after-header %}
10
{% endblock %}
11

  
templates/variants/armentieres/wcs/base.html
1
{% extends "wcs/base.html" %}
2

  
3
{% block placeholder-after-header %}
4
  {% if title %}
5
  <div class="arm-form-header">
6
	<div class="arm-form-header--content">
7
	  <h1 class="arm-form-header--title">{{ title }}</h1>
8
	</div>
9
  </div>
10
  {% endif %}
11
{% endblock %}
12

  
13
{% block wcs-form-title %}{% endblock %}
14

  
0
-