Projet

Général

Profil

0001-mnhn-new-theme-68742.patch

A. Berriot, 07 septembre 2022 16:02

Télécharger (9,78 ko)

Voir les différences:

Subject: [PATCH] mnhn: new theme (#68742)

 static/mnhn/_custom.scss           | 226 +++++++++++++++++++++++++++++
 static/mnhn/_vars.scss             |  97 +++++++++++++
 static/mnhn/config.json            |  14 ++
 static/mnhn/style.scss             |   6 +
 templates/variants/mnhn/theme.html |   9 ++
 5 files changed, 352 insertions(+)
 create mode 100644 static/mnhn/_custom.scss
 create mode 100644 static/mnhn/_vars.scss
 create mode 100644 static/mnhn/config.json
 create mode 100644 static/mnhn/style.scss
 create mode 100644 templates/variants/mnhn/theme.html
static/mnhn/_custom.scss
1
$toplink-separator: 1px solid rgba(34, 34, 34, 0.3);
2
$required-label-color: #ff0000;
3

  
4
%button {
5
    box-shadow: none;
6
    text-transform: uppercase;
7
    &:hover {
8
        box-shadow: none;
9
    }
10
}
11

  
12
%inverted-button {
13
    background-color: $white;
14
    color: $carbon;
15
    border: 2px solid $button-background;
16
    &:hover {
17
        border: 2px solid $button-hover-background;
18
        background: $gray-light-2;
19
        color: $carbon;
20
    }
21
}
22

  
23
%title {
24
    text-transform: uppercase;
25
}
26

  
27
main {
28
    line-height: 1.5em;
29
}
30
// header and navigation
31

  
32
div#header {
33
    background: $white;
34
    max-width: 100%;
35
    box-shadow: 0 9px 9px 0 rgba(0, 0, 0, 0.1);
36
    padding: $space-small $space-medium;
37
    @media screen and ($min-desktop-viewport) {
38
        padding: $space-large;
39
    }
40
}
41
#logo {
42
    @media screen and ($max-mobile-viewport) {
43
        padding-left: unset;
44
    }
45
}
46
#logo.has-logo a::before {
47
    @media screen and ($min-desktop-viewport) {
48
        z-index: 3;
49
        width: 100px;
50
        height: 62.5px
51
    }
52
}
53
.site-nav {
54
    z-index: 2;
55
    margin-bottom: $space-xlarge;
56
    @media screen and ($min-desktop-viewport) {
57
        margin-top: -$space-xlarge * 1.75;
58
    }
59
}
60
div#nav {
61
    max-width: 100%;
62
    padding: 0 $space-large 0 $space-small;
63

  
64
}
65
div.gru-nav {
66
    @media screen and ($min-desktop-viewport) {
67
        text-align: right;
68
    }
69
    @media screen and ($max-mobile-viewport) {
70
        .gru-nav-button {
71
            right: $space-medium;
72
            left: unset;
73
            & + ul::before {
74
                display: none;
75
            }
76
        }
77
        &.togglable .menu {
78
            box-shadow: 0 9px 9px 0 rgba(0, 0, 0, 0.1);
79
            & > li {
80
                border-bottom: 1px solid $gray-light-3;
81
            }
82
        }
83
    }
84
    li .menu--label, li .submenu--label {
85
        text-transform: uppercase;
86
        font-size: $fz-small;
87
        &:hover {
88
            padding-bottom: $space-small;
89
            border-bottom: 2px solid $carbon;
90
        }
91
    }
92
    li.selected .menu--label {
93
        padding-bottom: $space-small;
94
        border-bottom: 2px solid $carbon;
95
    }
96
    .submenu {
97
        @media screen and ($min-desktop-viewport) {
98
            box-shadow: 0 9px 9px 0 rgba(0, 0, 0, 0.1);
99
            font-size: $fz-xsmall;
100
            z-index: 101;
101
        }
102
    }
103
}
104
#toplinks {
105
    text-transform: uppercase;
106
    font-size: $fz-xxsmall;
107
    font-weight: 700;
108
    right: $space-xlarge;
109
    @media screen and ($max-mobile-viewport) {
110
        margin-right: $nav-menu-side;
111
        background: transparent;
112
    }
113
    a {
114
        color: $carbon;
115
        @media screen and ($max-mobile-viewport) {
116
            padding: $space-medium 0;
117
            margin-left: $space-large;
118
        }
119
        @media screen and ($min-desktop-viewport) {
120
            padding: $space-xsmall;
121
            &:not(:first-child) {
122
                padding-left: $space-medium;
123
                border-left: $toplink-separator;
124
            }
125
        }
126
    }
127
}
128

  
129
div#main-content-wrapper {
130
    z-index: 1;
131
}
132

  
133

  
134
a#publik-portal-agent {
135
    right: 45%;
136
    left: 45%;
137
    text-align: center;
138
}
139

  
140
// forms
141

  
142
.title label {
143
    text-transform: uppercase;
144
    font-weight: 700;
145
}
146

  
147
#side {
148
    font-size: 90%;
149
    border: $wcs-step-border-bottom;
150
    @media screen and ($min-desktop-viewport) {
151
        box-shadow: 0 3px 9px 0 rgba(0, 0, 0, 0.1);
152
    }
153
}
154
[role="radiogroup"] {
155
    margin-top: $space-medium;
156
}
157
.previous-button button {
158
    @extend %inverted-button;
159
}
160

  
161
label .required {
162
    color: $required-label-color;
163
}
164
// cells
165

  
166
.cell {
167
    h1, h2, h3, h4, h5, h6 {
168
        text-transform: uppercase;
169
        text-align: center;
170
    }
171
    h1 {
172
        font-size: 52px;
173
    }
174
    h2 {
175
        font-size: 36px;
176
    }
177
}
178

  
179
// links / underline expand/collapse animation
180
main a:not(.links-list *, .categories-cell *, .carrousel-content *, .pk-button, .pk-big-button, .account-management *) {
181
    background-size: 100% 2px;
182
    background-repeat: no-repeat;
183
    background-position: center 100%;
184
    background-image: linear-gradient(120deg, lighten($epicea, 15%), lighten($epicea, 15%));
185
    transition: background-size .2s ease-in-out;
186
    &:hover {
187
        background-image: linear-gradient(120deg, lighten($epicea, 35%), lighten($epicea, 35%));
188
        background-size: 100% 100%;
189
    }
190
}
191
//  other content
192

  
193
hr {
194
    margin: $space-large 0;
195
    border: none;
196
    border-bottom: 1px solid $gray-light-3;
197

  
198
}
199

  
200
// footers
201

  
202
.dark-footer {
203
    background: $carbon;
204
    display: flex;
205
    align-items: center;
206
    justify-content: center;
207
    text-transform: uppercase;
208
    padding: $space-large;
209
    
210
    img {
211
        margin-right: $space-large;
212
    }
213
    a {
214
        font-weight: 400;
215
        color: $white;
216
        &::after {
217
            font-family: FontAwesome;
218
            content: "\f061";
219
            margin-left: $space-small;
220

  
221
        }
222
    }
223
}
224
#footer-wrapper {
225
    margin-top: 0;
226
}
static/mnhn/_vars.scss
1
$carbon: #222222;
2
$white: #ffffff;
3
$epicea: #5d7b84;
4

  
5
$gray-secondary: #666666;
6
$gray-light-1: #f5f5f5;
7
$gray-light-2: #f0f0f0;
8
$gray-light-3: #d8d8d8;
9
$gray-secondary: #656565;
10

  
11
$primary-color: $epicea;
12

  
13
$space-xsmall: 0.25em;
14
$space-small: 0.5em;
15
$space-medium: 1em;
16
$space-large: 2em;
17
$space-xlarge: 3em;
18

  
19
// typo
20
$font-color: $carbon;
21
$font-family: Montserrat, Arial, sans-serif;
22
$font-size: 18px;
23
$font-line-height: 3.1em;
24
$base-font: 16;
25
$fz-1: 30em / $base-font;
26
$fz-2: 24em / $base-font;
27
$fz-3: 21em / $base-font;
28
$fz-4: 18em / $base-font;
29
$fz-small: 14em / $base-font;
30
$fz-xsmall: 12em / $base-font;;
31
$fz-xxsmall: 11em / $base-font;;
32

  
33
$width: 890px;
34
$link-color: $carbon;
35
$link-decoration: none;
36
$link-hover-decoration: none;
37

  
38
$header-logo-size: 59px 37px;
39
$responsive-menu: left-to-right;
40
$nav-color: $carbon;
41
$nav-background: transparent;
42
$nav-button-background: $white;
43
$nav-button-color: $carbon;
44

  
45
$nav-mobile-menu-background: $white;
46

  
47
$nav-item-background: transparent;
48
$nav-item-selected-background: $white;
49
$nav-item-selected-color: $carbon;
50

  
51
$nav-item-hover-background: transparent;
52
$nav-item-hover-color: $nav-color;
53
$nav-item-hover-border: 2px solid $carbon;
54

  
55
$nav-submenu-background: $gray-light-1;
56
$nav-submenu-color: $gray-secondary;
57

  
58
$toplinks-border-radius: 0;
59
$toplinks-background: $gray-light-2;
60
$toplinks-box-shadow: none;
61
$toplinks-padding: $space-medium;
62
$toplinks-border: none;
63

  
64
$cell-border: none;
65
$cell-background: $gray-light-1;
66
$cell-entry-hover-background: $epicea;
67
$cell-entry-hover-color: $white;
68

  
69
$title-color: $carbon;
70
$title-transform: uppercase;
71
$title-font-size: $fz-2;
72
$title-weight: 700;
73
$title-background: transparent;
74
$title-padding: $space-medium;
75

  
76
$button-background: $epicea;
77
$button-border-radius: 2px;
78
$button-border: none;
79
$button-hover-background: darken($button-background, 20%);
80
$button-focus-outline: 2px solid $carbon;
81
$button-focus-outline-offset: 2px;
82
$cancel-button-style: '%inverted-button';
83
$buttons-order: previous, cancel (grow), submit;
84

  
85
$form-sidebar-width: 30%;
86
$form-sidebar-position: right;
87

  
88
$widget-background: lighten($gray-light-1, 2%);
89
$widget-focus-border: 1px solid $primary-color;
90
$widget-focus-outline: 1px solid $primary-color;
91

  
92
$wcs-step-color: $carbon;
93
$wcs-step-border-bottom: 1px solid $gray-light-3;
94

  
95
$footer-background: $epicea;
96
$footer-color: $white;
97
$footer-link-color: $white;
static/mnhn/config.json
1
{
2
  "label": "Muséum National d'Histoire Naturelle",
3
  "variables": {
4
    "theme_color": "#5d7b84"
5
  },
6
  "settings": {
7
    "combo": {
8
      "COMBO_ASSET_SLOTS.update": {
9
        "header:logo": { "label": "Têtière : logo" },
10
        "footer:logo": { "label": "Pied de page : logo" }
11
      }
12
    }
13
  }
14
}
static/mnhn/style.scss
1
@charset "UTF-8";
2
@import '../includes/fonts/montserrat';
3

  
4
@import 'vars';
5
@import '../includes/publik';
6
@import 'custom';
templates/variants/mnhn/theme.html
1
{% extends "theme.html" %}
2
{% block footer-pre %}
3
<div class="dark-footer">
4
    <img src="{{site_base}}/assets/footer:logo" alt="Muséum National d'Histoire Naturelle - Logo">
5
    <h2>
6
        <a href="https://www.mnhn.fr/">Retourner sur le site institutionnel du Muséum</a>
7
    </h2>
8
</div>
9
{% endblock %}
0
-