@gemeentenijmegen/layout-css 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,288 @@
1
+ # EUROPEAN UNION PUBLIC LICENCE v. 1.2
2
+
3
+ EUPL © the European Union 2007, 2016
4
+
5
+ This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
6
+ below) which is provided under the terms of this Licence. Any use of the Work,
7
+ other than as authorised under this Licence is prohibited (to the extent such
8
+ use is covered by a right of the copyright holder of the Work).
9
+
10
+ The Work is provided under the terms of this Licence when the Licensor (as
11
+ defined below) has placed the following notice immediately following the
12
+ copyright notice for the Work:
13
+
14
+ Licensed under the EUPL
15
+
16
+ or has expressed by any other means his willingness to license under the EUPL.
17
+
18
+ ## 1. Definitions
19
+
20
+ In this Licence, the following terms have the following meaning:
21
+
22
+ - ‘The Licence’: this Licence.
23
+
24
+ - ‘The Original Work’: the work or software distributed or communicated by the
25
+ Licensor under this Licence, available as Source Code and also as Executable
26
+ Code as the case may be.
27
+
28
+ - ‘Derivative Works’: the works or software that could be created by the
29
+ Licensee, based upon the Original Work or modifications thereof. This Licence
30
+ does not define the extent of modification or dependence on the Original Work
31
+ required in order to classify a work as a Derivative Work; this extent is
32
+ determined by copyright law applicable in the country mentioned in Article 15.
33
+
34
+ - ‘The Work’: the Original Work or its Derivative Works.
35
+
36
+ - ‘The Source Code’: the human-readable form of the Work which is the most
37
+ convenient for people to study and modify.
38
+
39
+ - ‘The Executable Code’: any code which has generally been compiled and which is
40
+ meant to be interpreted by a computer as a program.
41
+
42
+ - ‘The Licensor’: the natural or legal person that distributes or communicates
43
+ the Work under the Licence.
44
+
45
+ - ‘Contributor(s)’: any natural or legal person who modifies the Work under the
46
+ Licence, or otherwise contributes to the creation of a Derivative Work.
47
+
48
+ - ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
49
+ the Work under the terms of the Licence.
50
+
51
+ - ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
52
+ renting, distributing, communicating, transmitting, or otherwise making
53
+ available, online or offline, copies of the Work or providing access to its
54
+ essential functionalities at the disposal of any other natural or legal
55
+ person.
56
+
57
+ ## 2. Scope of the rights granted by the Licence
58
+
59
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
60
+ sublicensable licence to do the following, for the duration of copyright vested
61
+ in the Original Work:
62
+
63
+ - use the Work in any circumstance and for all usage,
64
+ - reproduce the Work,
65
+ - modify the Work, and make Derivative Works based upon the Work,
66
+ - communicate to the public, including the right to make available or display
67
+ the Work or copies thereof to the public and perform publicly, as the case may
68
+ be, the Work,
69
+ - distribute the Work or copies thereof,
70
+ - lend and rent the Work or copies thereof,
71
+ - sublicense rights in the Work or copies thereof.
72
+
73
+ Those rights can be exercised on any media, supports and formats, whether now
74
+ known or later invented, as far as the applicable law permits so.
75
+
76
+ In the countries where moral rights apply, the Licensor waives his right to
77
+ exercise his moral right to the extent allowed by law in order to make effective
78
+ the licence of the economic rights here above listed.
79
+
80
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
81
+ any patents held by the Licensor, to the extent necessary to make use of the
82
+ rights granted on the Work under this Licence.
83
+
84
+ ## 3. Communication of the Source Code
85
+
86
+ The Licensor may provide the Work either in its Source Code form, or as
87
+ Executable Code. If the Work is provided as Executable Code, the Licensor
88
+ provides in addition a machine-readable copy of the Source Code of the Work
89
+ along with each copy of the Work that the Licensor distributes or indicates, in
90
+ a notice following the copyright notice attached to the Work, a repository where
91
+ the Source Code is easily and freely accessible for as long as the Licensor
92
+ continues to distribute or communicate the Work.
93
+
94
+ ## 4. Limitations on copyright
95
+
96
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from
97
+ any exception or limitation to the exclusive rights of the rights owners in the
98
+ Work, of the exhaustion of those rights or of other applicable limitations
99
+ thereto.
100
+
101
+ ## 5. Obligations of the Licensee
102
+
103
+ The grant of the rights mentioned above is subject to some restrictions and
104
+ obligations imposed on the Licensee. Those obligations are the following:
105
+
106
+ Attribution right: The Licensee shall keep intact all copyright, patent or
107
+ trademarks notices and all notices that refer to the Licence and to the
108
+ disclaimer of warranties. The Licensee must include a copy of such notices and a
109
+ copy of the Licence with every copy of the Work he/she distributes or
110
+ communicates. The Licensee must cause any Derivative Work to carry prominent
111
+ notices stating that the Work has been modified and the date of modification.
112
+
113
+ Copyleft clause: If the Licensee distributes or communicates copies of the
114
+ Original Works or Derivative Works, this Distribution or Communication will be
115
+ done under the terms of this Licence or of a later version of this Licence
116
+ unless the Original Work is expressly distributed only under this version of the
117
+ Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
118
+ (becoming Licensor) cannot offer or impose any additional terms or conditions on
119
+ the Work or Derivative Work that alter or restrict the terms of the Licence.
120
+
121
+ Compatibility clause: If the Licensee Distributes or Communicates Derivative
122
+ Works or copies thereof based upon both the Work and another work licensed under
123
+ a Compatible Licence, this Distribution or Communication can be done under the
124
+ terms of this Compatible Licence. For the sake of this clause, ‘Compatible
125
+ Licence’ refers to the licences listed in the appendix attached to this Licence.
126
+ Should the Licensee's obligations under the Compatible Licence conflict with
127
+ his/her obligations under this Licence, the obligations of the Compatible
128
+ Licence shall prevail.
129
+
130
+ Provision of Source Code: When distributing or communicating copies of the Work,
131
+ the Licensee will provide a machine-readable copy of the Source Code or indicate
132
+ a repository where this Source will be easily and freely available for as long
133
+ as the Licensee continues to distribute or communicate the Work.
134
+
135
+ Legal Protection: This Licence does not grant permission to use the trade names,
136
+ trademarks, service marks, or names of the Licensor, except as required for
137
+ reasonable and customary use in describing the origin of the Work and
138
+ reproducing the content of the copyright notice.
139
+
140
+ ## 6. Chain of Authorship
141
+
142
+ The original Licensor warrants that the copyright in the Original Work granted
143
+ hereunder is owned by him/her or licensed to him/her and that he/she has the
144
+ power and authority to grant the Licence.
145
+
146
+ Each Contributor warrants that the copyright in the modifications he/she brings
147
+ to the Work are owned by him/her or licensed to him/her and that he/she has the
148
+ power and authority to grant the Licence.
149
+
150
+ Each time You accept the Licence, the original Licensor and subsequent
151
+ Contributors grant You a licence to their contributions to the Work, under the
152
+ terms of this Licence.
153
+
154
+ ## 7. Disclaimer of Warranty
155
+
156
+ The Work is a work in progress, which is continuously improved by numerous
157
+ Contributors. It is not a finished work and may therefore contain defects or
158
+ ‘bugs’ inherent to this type of development.
159
+
160
+ For the above reason, the Work is provided under the Licence on an ‘as is’ basis
161
+ and without warranties of any kind concerning the Work, including without
162
+ limitation merchantability, fitness for a particular purpose, absence of defects
163
+ or errors, accuracy, non-infringement of intellectual property rights other than
164
+ copyright as stated in Article 6 of this Licence.
165
+
166
+ This disclaimer of warranty is an essential part of the Licence and a condition
167
+ for the grant of any rights to the Work.
168
+
169
+ ## 8. Disclaimer of Liability
170
+
171
+ Except in the cases of wilful misconduct or damages directly caused to natural
172
+ persons, the Licensor will in no event be liable for any direct or indirect,
173
+ material or moral, damages of any kind, arising out of the Licence or of the use
174
+ of the Work, including without limitation, damages for loss of goodwill, work
175
+ stoppage, computer failure or malfunction, loss of data or any commercial
176
+ damage, even if the Licensor has been advised of the possibility of such damage.
177
+ However, the Licensor will be liable under statutory product liability laws as
178
+ far such laws apply to the Work.
179
+
180
+ ## 9. Additional agreements
181
+
182
+ While distributing the Work, You may choose to conclude an additional agreement,
183
+ defining obligations or services consistent with this Licence. However, if
184
+ accepting obligations, You may act only on your own behalf and on your sole
185
+ responsibility, not on behalf of the original Licensor or any other Contributor,
186
+ and only if You agree to indemnify, defend, and hold each Contributor harmless
187
+ for any liability incurred by, or claims asserted against such Contributor by
188
+ the fact You have accepted any warranty or additional liability.
189
+
190
+ ## 10. Acceptance of the Licence
191
+
192
+ The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
193
+ placed under the bottom of a window displaying the text of this Licence or by
194
+ affirming consent in any other similar way, in accordance with the rules of
195
+ applicable law. Clicking on that icon indicates your clear and irrevocable
196
+ acceptance of this Licence and all of its terms and conditions.
197
+
198
+ Similarly, you irrevocably accept this Licence and all of its terms and
199
+ conditions by exercising any rights granted to You by Article 2 of this Licence,
200
+ such as the use of the Work, the creation by You of a Derivative Work or the
201
+ Distribution or Communication by You of the Work or copies thereof.
202
+
203
+ ## 11. Information to the public
204
+
205
+ In case of any Distribution or Communication of the Work by means of electronic
206
+ communication by You (for example, by offering to download the Work from a
207
+ remote location) the distribution channel or media (for example, a website) must
208
+ at least provide to the public the information requested by the applicable law
209
+ regarding the Licensor, the Licence and the way it may be accessible, concluded,
210
+ stored and reproduced by the Licensee.
211
+
212
+ ## 12. Termination of the Licence
213
+
214
+ The Licence and the rights granted hereunder will terminate automatically upon
215
+ any breach by the Licensee of the terms of the Licence.
216
+
217
+ Such a termination will not terminate the licences of any person who has
218
+ received the Work from the Licensee under the Licence, provided such persons
219
+ remain in full compliance with the Licence.
220
+
221
+ ## 13. Miscellaneous
222
+
223
+ Without prejudice of Article 9 above, the Licence represents the complete
224
+ agreement between the Parties as to the Work.
225
+
226
+ If any provision of the Licence is invalid or unenforceable under applicable
227
+ law, this will not affect the validity or enforceability of the Licence as a
228
+ whole. Such provision will be construed or reformed so as necessary to make it
229
+ valid and enforceable.
230
+
231
+ The European Commission may publish other linguistic versions or new versions of
232
+ this Licence or updated versions of the Appendix, so far this is required and
233
+ reasonable, without reducing the scope of the rights granted by the Licence. New
234
+ versions of the Licence will be published with a unique version number.
235
+
236
+ All linguistic versions of this Licence, approved by the European Commission,
237
+ have identical value. Parties can take advantage of the linguistic version of
238
+ their choice.
239
+
240
+ ## 14. Jurisdiction
241
+
242
+ Without prejudice to specific agreement between parties,
243
+
244
+ - any litigation resulting from the interpretation of this License, arising
245
+ between the European Union institutions, bodies, offices or agencies, as a
246
+ Licensor, and any Licensee, will be subject to the jurisdiction of the Court
247
+ of Justice of the European Union, as laid down in article 272 of the Treaty on
248
+ the Functioning of the European Union,
249
+
250
+ - any litigation arising between other parties and resulting from the
251
+ interpretation of this License, will be subject to the exclusive jurisdiction
252
+ of the competent court where the Licensor resides or conducts its primary
253
+ business.
254
+
255
+ ## 15. Applicable Law
256
+
257
+ Without prejudice to specific agreement between parties,
258
+
259
+ - this Licence shall be governed by the law of the European Union Member State
260
+ where the Licensor has his seat, resides or has his registered office,
261
+
262
+ - this licence shall be governed by Belgian law if the Licensor has no seat,
263
+ residence or registered office inside a European Union Member State.
264
+
265
+ ## Appendix
266
+
267
+ ‘Compatible Licences’ according to Article 5 EUPL are:
268
+
269
+ - GNU General Public License (GPL) v. 2, v. 3
270
+ - GNU Affero General Public License (AGPL) v. 3
271
+ - Open Software License (OSL) v. 2.1, v. 3.0
272
+ - Eclipse Public License (EPL) v. 1.0
273
+ - CeCILL v. 2.0, v. 2.1
274
+ - Mozilla Public Licence (MPL) v. 2
275
+ - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
276
+ - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
277
+ works other than software
278
+ - European Union Public Licence (EUPL) v. 1.1, v. 1.2
279
+ - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
280
+ Reciprocity (LiLiQ-R+).
281
+
282
+ The European Commission may update this Appendix to later versions of the above
283
+ licences without producing a new version of the EUPL, as long as they provide
284
+ the rights granted in Article 2 of this Licence and protect the covered Source
285
+ Code from exclusive appropriation.
286
+
287
+ All other changes or additions to this Appendix require the production of a new
288
+ EUPL version.
package/README.md ADDED
@@ -0,0 +1,278 @@
1
+ # Nijmegen Design System Layout
2
+
3
+ This package contains the css layout options (breakpoints, containers, grid and spacing) for the Design System of the municipality of Nijmegen. The setup of this package is based on the [NL Design System principles](https://nldesignsystem.nl/richtlijnen/stijl/ruimte/) and is inspired by the [Bootstrap v5.3 Layout](https://getbootstrap.com/docs/5.3/layout).
4
+
5
+ ## Breakpoints
6
+
7
+ This layout contains 6 breakpoints which have a default value and are customizable by usings Sass variables based on your design tokens.
8
+
9
+ | Breakpoint | Class infix | Default dimensions | Design token | Sass variable |
10
+ | ----------------- | ----------- | ------------------ | ------------------------- | -------------------------- |
11
+ | Extra small | | < 576px | `nijmegen.breakpoint.xs` | `$nijmegen-breakpoint-xs` |
12
+ | Small | sm | ≥576px | `nijmegen.breakpoint.sm` | `$nijmegen-breakpoint-sm` |
13
+ | Medium | md | ≥768px | `nijmegen.breakpoint.md` | `$nijmegen-breakpoint-md` |
14
+ | Large | lg | ≥992px | `nijmegen.breakpoint.lg` | `$nijmegen-breakpoint-lg` |
15
+ | Extra large | xl | ≥1200px | `nijmegen.breakpoint.xl` | `$nijmegen-breakpoint-xl` |
16
+ | Extra extra large | xxl | ≥1400px | `nijmegen.breakpoint.xxl` | `$nijmegen-breakpoint-xxl` |
17
+
18
+ ## Containers
19
+
20
+ Containers are an implementation of the [Bootstrap v5.3 Containers](https://getbootstrap.com/docs/5.3/layout/containers/). The implementation contains all three different containers with custom class naming:
21
+
22
+ - `.nijmegen-container`, which sets a `max-width` at each responsive breakpoint
23
+ - `.nijmegen-container-{breakpoint}`, which is `width: 100%` until the specified breakpoint
24
+ - `.nijmegen-container-fluid`, which is `width: 100%` at all breakpoints
25
+
26
+ The following `max-width` values are used wicht are customizable based on the implementation of the design tokens:
27
+
28
+ | Breakpoint | Default `max-width` value | Design token | Sass variable |
29
+ | ----------------- | ------------------------- | ---------------------------------- | ----------------------------------- |
30
+ | Extra small | 100% | | |
31
+ | Small | 540px | `nijmegen.container.max-width.sm` | `$nijmegen-container-max-width-sm` |
32
+ | Medium | 720px | `nijmegen.container.max-width.md` | `$nijmegen-container-max-width-md` |
33
+ | Large | 960px | `nijmegen.container.max-width.lg` | `$nijmegen-container-max-width-lg` |
34
+ | Extra large | 1140px | `nijmegen.container.max-width.xl` | `$nijmegen-container-max-width-xl` |
35
+ | Extra extra large | 1320px | `nijmegen.container.max-width.xxl` | `$nijmegen-container-max-width-xxl` |
36
+
37
+ Other container design tokens:
38
+
39
+ | Design token | Default value | Sass variable | Css variable |
40
+ | ----------------------------------------- | ------------------- | ------------------------------------------ | ------------------------------------------------ |
41
+ | `nijmegen.container.padding-inline-start` | `nijmegen.space.25` | `$nijmegen-container-padding-inline-start` | `var(--nijmegen-container-padding-inline-start)` |
42
+ | `nijmegen.container.padding-inline-end` | `nijmegen.space.25` | `$nijmegen-container-padding-inline-end` | `var(--nijmegen-container-padding-inline-end)` |
43
+
44
+ ### Default container
45
+
46
+ ```html
47
+ <div class="nijmegen-container">
48
+ <!-- Content here -->
49
+ </div>
50
+ ```
51
+
52
+ ### Responsive containers
53
+
54
+ ```html
55
+ <div class="nijmegen-container-sm">100% wide until small breakpoint</div>
56
+ <div class="nijmegen-container-md">100% wide until medium breakpoint</div>
57
+ <div class="nijmegen-container-lg">100% wide until large breakpoint</div>
58
+ <div class="nijmegen-container-xl">100% wide until extra large breakpoint</div>
59
+ <div class="nijmegen-container-xxl">100% wide until extra extra large breakpoint</div>
60
+ ```
61
+
62
+ ### Fluid container (full width)
63
+
64
+ ```html
65
+ <div class="nijmegen-container-fluid">
66
+ <!-- Content here -->
67
+ </div>
68
+ ```
69
+
70
+ ## Grid
71
+
72
+ The grid system is an implementation of the [Bootstrap v5.3 CSS Grid](https://getbootstrap.com/docs/5.3/layout/css-grid/). The default setup is a 12 column grid which need to be placed inside the `nijmegen-grid` element. The grid supports responsive classeds to adjust the layout across viewports.
73
+
74
+ | Design token | Default value | Sass variable | Css variable |
75
+ | ----------------------- | ------------- | ------------------------ | --------------------------- |
76
+ | `nijmegen.grid.columns` | 12 | `$nijmegen-grid-columns` | |
77
+ | `nijmegen.grid.gap` | 1.5rem | `$nijmegen-grid-gap` | `var(--nijmegen-grid-gap)` |
78
+ | `nijmegen.grid.rows` | 1 | `$nijmegen-grid-rows` | `var(--nijmegen-grid-rows)` |
79
+
80
+ ### Columns
81
+
82
+ ```html
83
+ <div class="nijmegen-grid">
84
+ <div class="nijmegen-g-col-4">col 1/3</div>
85
+ <div class="nijmegen-g-col-4">col 2/3</div>
86
+ <div class="nijmegen-g-col-4">col 3/3</div>
87
+ </div>
88
+ ```
89
+
90
+ ### Responsive
91
+
92
+ The following example has 2 columns but grows to 3 columns from medium breakpoint and above.
93
+
94
+ ```html
95
+ <div class="nijmegen-grid">
96
+ <div class="nijmegen-g-col-6 nijmegen-g-col-md-4">.nijmegen-g-col-6 .nijmegen-g-col-md-4</div>
97
+ <div class="nijmegen-g-col-6 nijmegen-g-col-md-4">.nijmegen-g-col-6 .nijmegen-g-col-md-4</div>
98
+ <div class="nijmegen-g-col-6 nijmegen-g-col-md-4">.nijmegen-g-col-6 .nijmegen-g-col-md-4</div>
99
+ </div>
100
+ ```
101
+
102
+ ### Starts
103
+
104
+ With start classes you can implement (responsive) starting points to the columns.
105
+
106
+ ```html
107
+ <div class="nijmegen-grid">
108
+ <div class="nijmegen-g-col-3 nijmegen-g-start-2">start by 2 col with a 3 col width column</div>
109
+ <div class="nijmegen-g-col-4 nijmegen-g-start-6">.start by 6 col with a 4 col width column</div>
110
+ </div>
111
+ ```
112
+
113
+ ### Other
114
+
115
+ Auto columns and nesting are also supported, please check the [Bootstrap v5.3 documentation](https://getbootstrap.com/docs/5.3/layout/css-grid/) for details.
116
+
117
+ ## Spacing
118
+
119
+ Spacing is a responsive wrapper for setting `margin-inline-start`, `margin-inline-end`, `padding-inline-start` and `padding-inline-end` values on elements based on the [Bootstrap v5.3 spacing utility api](https://getbootstrap.com/docs/5.3/utilities/spacing/). The api has generated custom (responsive) classes with the following notation `nijmegen-{{property}{side}{breakpoint}-{size}`.
120
+
121
+ **`{property}` options:**
122
+
123
+ - `margin-inline`, horizontal margin
124
+ - `padding-inline`, horizontal padding
125
+ - `margin-block`, vertial margin
126
+ - `padding-block`, horizontal padding
127
+
128
+ **`{side}` options:**
129
+
130
+ - `-start`
131
+ - `-end`
132
+ - blank, for using both sides
133
+
134
+ **`{breakpoint}` options:**
135
+
136
+ - `-sm`
137
+ - `-md`
138
+ - `-lg`
139
+ - `-xl`
140
+ - `-xxl`
141
+ - blank, used in all viewports
142
+
143
+ **`{size}` options:**
144
+
145
+ - `0`
146
+ - `12`
147
+ - `25`
148
+ - `50`
149
+ - `75`
150
+ - `100`
151
+ - `125`
152
+ - `150`
153
+ - `200`
154
+ - `250`
155
+ - `300`
156
+ - `400`
157
+ - `500`
158
+ - `600`
159
+
160
+ By default the `!important` statement is added to all spacing ultilities to make sure the correct spacings are forced added if the classes are set. You can disable this by changing the following Sass variable and recompile the `layout.scss` file.
161
+
162
+ ```scss
163
+ $nijmegen-enable-important-utilities-on-spacing: false;
164
+ ```
165
+
166
+ ### Design tokens
167
+
168
+ | Design token | Default value | Sass variable | Css variable |
169
+ | -------------------- | ------------- | ---------------------------------------------- | --------------------------- |
170
+ | `nijmegen.space.0` | 0 | `map.set($nijmegen-space, "0", $new-value);` | `var(--nijmegen-space-0)` |
171
+ | `nijmegen.space.12` | 0.125rem | `map.set($nijmegen-space, "12", $new-value);` | `var(--nijmegen-space-12)` |
172
+ | `nijmegen.space.25` | 0.25rem | `map.set($nijmegen-space, "25", $new-value);` | `var(--nijmegen-space-25)` |
173
+ | `nijmegen.space.50` | 0.5rem | `map.set($nijmegen-space, "50", $new-value);` | `var(--nijmegen-space-50)` |
174
+ | `nijmegen.space.75` | 0.75rem | `map.set($nijmegen-space, "75", $new-value);` | `var(--nijmegen-space-75)` |
175
+ | `nijmegen.space.100` | 1rem | `map.set($nijmegen-space, "100", $new-value);` | `var(--nijmegen-space-100)` |
176
+ | `nijmegen.space.125` | 1.25rem | `map.set($nijmegen-space, "125", $new-value);` | `var(--nijmegen-space-125)` |
177
+ | `nijmegen.space.150` | 1.5rem | `map.set($nijmegen-space, "150", $new-value);` | `var(--nijmegen-space-150)` |
178
+ | `nijmegen.space.200` | 2rem | `map.set($nijmegen-space, "200", $new-value);` | `var(--nijmegen-space-200)` |
179
+ | `nijmegen.space.250` | 2.5rem | `map.set($nijmegen-space, "250", $new-value);` | `var(--nijmegen-space-250)` |
180
+ | `nijmegen.space.300` | 3rem | `map.set($nijmegen-space, "300", $new-value);` | `var(--nijmegen-space-300)` |
181
+ | `nijmegen.space.400` | 4rem | `map.set($nijmegen-space, "400", $new-value);` | `var(--nijmegen-space-400)` |
182
+ | `nijmegen.space.500` | 5rem | `map.set($nijmegen-space, "500", $new-value);` | `var(--nijmegen-space-500)` |
183
+ | `nijmegen.space.600` | 6rem | `map.set($nijmegen-space, "600", $new-value);` | `var(--nijmegen-space-600)` |
184
+
185
+ ### Horizontal centering
186
+
187
+ The `.nijmegen-margin-inline-auto` class is available for horizontally centering for content that has `display: block` and a `width` set.
188
+
189
+ ```html
190
+ <div class="nijmegen-margin-inline-auto" style="width: 200px;">Vertically centered element</div>
191
+ ```
192
+
193
+ ### Examples
194
+
195
+ ```html
196
+ <div class="nijmegen-margin-inline-start-25">start 0.25rem margin</div>
197
+
198
+ <div class="nijmegen-margin-inline-end-250">end 2.5rem margin</div>
199
+
200
+ <div class="nijmegen-margin-inline-300">horizonal 3rem margin</div>
201
+
202
+ <div class="nijmegen-padding-inline-500">horizontal 5rem padding</div>
203
+
204
+ <div class="nijmegen-margin-block-start-0">vertical 0 margin</div>
205
+
206
+ <div class="nijmegen-margin-block-end-75">vertical end 0.75rem margin</div>
207
+
208
+ <div class="nijmegen-margin-block-300">vertical 3rem margin</div>
209
+
210
+ <div class="nijmegen-padding-block-600">vertical 6rem padding</div>
211
+ ```
212
+
213
+ ## Customization
214
+
215
+ It is possible to use your onw values based on the previous mentioned design tokens. Most of the design tokens have a CSS variable option for customization but **some tokens can only be customizated by using the Sass variables**. For example, the breakpoints are used in media queries so customization is only possible via loading your design tokens sass file and compile the `layout.scss` file to your custom css file. Use of the css variable option `var()` is not possible because this function can only be used to set a value on a property of an element, [see W3 docs](https://www.w3.org/TR/css-variables-1/#using-variables).
216
+
217
+ ### Example via Sass variables
218
+
219
+ custom.scss:
220
+
221
+ ```scss
222
+ @import "~gemeentenijmegen/layout-css/src/layout";
223
+
224
+ // import or write your variables
225
+ @import "~gemeentenijmegen/design-tokens/dist/variables
226
+ ```
227
+
228
+ For example by using [Rollup](https://rollupjs.org/)
229
+
230
+ rollup.config.mjs:
231
+
232
+ ```js
233
+ export default {
234
+ input: "custom.scss",
235
+ output: {
236
+ file: "dist/my-layout.css",
237
+ format: "esm",
238
+ },
239
+ };
240
+ ```
241
+
242
+ Now run:
243
+
244
+ ```zsh
245
+ rollup -c
246
+ ```
247
+
248
+ ### Example via CSS `var()`
249
+
250
+ ```html
251
+ <!doctype html>
252
+ <html lang="nl">
253
+ <head>
254
+ <title>Example page</title>
255
+ <link rel="stylesheet" href="node_modules/@gemeentenijmegen/layout-css/dist/layout.min.css" />
256
+ <!-- load your custom design tokens -->
257
+ <link rel="stylesheet" href="node_modules/@gemeentenijmegen/design-tokens/dist/index.css'" />
258
+ <!-- or write them in your own "theme" following NL Design System standards -->
259
+ <style>
260
+ .my-theme {
261
+ --nijmegen-space-inline-0: 0.5rem;
262
+ }
263
+ </style>
264
+ </head>
265
+ <body>
266
+ <div class="nijmegen-theme">
267
+ <div class="nijmegen-padding-inline-0">0rem horizontal padding</div>
268
+ </div>
269
+ <div class="my-theme">
270
+ <div class="nijmegen-padding-inline-0">0.5rem horizontal padding</div>
271
+ </div>
272
+ </body>
273
+ </html>
274
+ ```
275
+
276
+ ## License
277
+
278
+ Distributed under the EUPL v1.2 License.
@@ -0,0 +1,51 @@
1
+ /*! Based on Bootstrap v5.1.3 Copyright (c) 2011-2024 The Bootstrap Authors */
2
+ /* stylelint-disable-next-line scss/dollar-variable-pattern */
3
+ .nijmegen-container,
4
+ .nijmegen-container-fluid,
5
+ .nijmegen-container-xxl,
6
+ .nijmegen-container-xl,
7
+ .nijmegen-container-lg,
8
+ .nijmegen-container-md,
9
+ .nijmegen-container-sm {
10
+ margin-inline-end: auto;
11
+ margin-inline-start: auto;
12
+ padding-inline-end: var(--nijmegen-container-padding-inline-end, var(--nijmegen-space-inline-sm, 0.75rem));
13
+ padding-inline-start: var(--nijmegen-container-padding-inline-end, var(--nijmegen-space-inline-sm, 0.75rem));
14
+ width: 100%; /* stylelint-disable-line property-disallowed-list */
15
+ }
16
+
17
+ @media (min-width: 576px) {
18
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
19
+ .nijmegen-container-sm, .nijmegen-container {
20
+ max-width: 540px; /* stylelint-disable-line property-disallowed-list */
21
+ }
22
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
23
+ }
24
+ @media (min-width: 768px) {
25
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
26
+ .nijmegen-container-md, .nijmegen-container-sm, .nijmegen-container {
27
+ max-width: 720px; /* stylelint-disable-line property-disallowed-list */
28
+ }
29
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
30
+ }
31
+ @media (min-width: 992px) {
32
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
33
+ .nijmegen-container-lg, .nijmegen-container-md, .nijmegen-container-sm, .nijmegen-container {
34
+ max-width: 960px; /* stylelint-disable-line property-disallowed-list */
35
+ }
36
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
37
+ }
38
+ @media (min-width: 1200px) {
39
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
40
+ .nijmegen-container-xl, .nijmegen-container-lg, .nijmegen-container-md, .nijmegen-container-sm, .nijmegen-container {
41
+ max-width: 1140px; /* stylelint-disable-line property-disallowed-list */
42
+ }
43
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
44
+ }
45
+ @media (min-width: 1400px) {
46
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
47
+ .nijmegen-container-xxl, .nijmegen-container-xl, .nijmegen-container-lg, .nijmegen-container-md, .nijmegen-container-sm, .nijmegen-container {
48
+ max-width: 1320px; /* stylelint-disable-line property-disallowed-list */
49
+ }
50
+ /* stylelint-disable-line scss/dollar-variable-default, scss/dollar-variable-pattern */
51
+ }