murb_design_system 0.1.0 → 0.2.0

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +23 -1
  4. data/Gemfile +1 -0
  5. data/Gemfile.lock +61 -20
  6. data/README.md +16 -6
  7. data/_navigation.html.erb +15 -0
  8. data/basis.html.erb +340 -0
  9. data/bin/build +41 -0
  10. data/bin/watch +25 -0
  11. data/blocks.html.erb +161 -0
  12. data/dist/.gitkeep +0 -0
  13. data/dist/GLOBE---1850-2024-MO.png +0 -0
  14. data/doc/calculations.ods +0 -0
  15. data/html2canvas.min.js +20 -0
  16. data/index.html.erb +127 -0
  17. data/layout.html.erb +84 -0
  18. data/lib/murb_design_system/version.rb +1 -1
  19. data/navigation.html.erb +80 -0
  20. data/print.html.erb +76 -0
  21. data/promo.html.erb +247 -0
  22. data/vendor/assets/stylesheets/article.scss +115 -0
  23. data/vendor/assets/stylesheets/buttons.scss +64 -35
  24. data/vendor/assets/stylesheets/cards.scss +4 -8
  25. data/vendor/assets/stylesheets/devise.scss +1 -0
  26. data/vendor/assets/stylesheets/forms.scss +93 -15
  27. data/vendor/assets/stylesheets/grid.scss +78 -0
  28. data/vendor/assets/stylesheets/html.scss +325 -13
  29. data/vendor/assets/stylesheets/invoice.scss +10 -2
  30. data/vendor/assets/stylesheets/list-variants.scss +83 -0
  31. data/vendor/assets/stylesheets/meta.scss +30 -0
  32. data/vendor/assets/stylesheets/microformats.scss +39 -0
  33. data/vendor/assets/stylesheets/navigation.scss +75 -7
  34. data/vendor/assets/stylesheets/notice.scss +63 -5
  35. data/vendor/assets/stylesheets/print.scss +53 -5
  36. data/vendor/assets/stylesheets/tables.scss +39 -1
  37. data/vendor/assets/stylesheets/utils.scss +54 -5
  38. data/vendor/assets/stylesheets/variables.scss +55 -13
  39. data/vendor/assets/stylesheets/works.scss +3 -3
  40. metadata +52 -8
  41. data/vendor/assets/stylesheets/customers.scss +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e75ed719a2a7f8cbe5b2188e8f608950e51855aaa0c016a9a7e42020757bac7a
4
- data.tar.gz: 002353bd083622339656be5789fe8686d220d991675693beac143eef813e358d
3
+ metadata.gz: 8dcadd7bc9ec8288bb945f9b21a7c45c45d8902114215e4614f89fa965b6b8f9
4
+ data.tar.gz: 71dedccbc9057140736248f88fb8fe19a7389fe25c7607ffb1c79caa921dfa4b
5
5
  SHA512:
6
- metadata.gz: 8859deb98cce7e10f9292fcc44990e392dcfe2bcedee76fd64b42fd370b880ace92e84e308bb083a2504bbe74a0ce1283a8918cf212d28eb86b81b2e7ad05b80
7
- data.tar.gz: 93c31c7c692edc37d83932c45df627e432ccffc6d238793b0a78a5c910f4fa50ab56449102af5d64ef8f0e6da52e5134683074e2659af6086c56afc57db554d5
6
+ metadata.gz: f30b4f943c81060359ecc4118ccc799e19b4e915d9007ad392930571cd9424ca7cb480f3d9dc0a0e739e7ee34140cb8a2c3bacd88662f53f53b8917b7618c071
7
+ data.tar.gz: 8995f0be639879e58ca8d83179bb57b7a5eb58898740fbb80e2cca5b5bc4f00a50d635f663ae1823a043f833b6cc8a9d3c6e625b7037ab6edcd835336ad1583f
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 4.0.6
data/CHANGELOG.md CHANGED
@@ -1,4 +1,26 @@
1
- ## [Unreleased]
1
+ ## [unreleased]
2
+
3
+ ...
4
+
5
+ ## [0.2.0] - 2026-09-27
6
+
7
+ - Dark mode introduced: automatically adjust the theme colours based on `@media (prefers-color-scheme: dark)`
8
+ - Multiple bug fixes, including contrast fixes for improved accessibility
9
+ - Initial support for microformat notations
10
+ - Definition list styling
11
+ - .sticky class for nav
12
+ - Allow for an `aside` *next* to a `main`
13
+ - Button within small
14
+ - Added footer styling
15
+ - Improved form styling
16
+ - Block quotes
17
+ - pre / code styling
18
+ - tables
19
+ - ascending descending icons
20
+ - fluid ui text
21
+ - article mode (larger text)
22
+ - **breaking** .u-columns--reduced to .u-column--reduced
23
+ - **experimental** .grid to enable a CSS grid based layout
2
24
 
3
25
  ## [0.1.0] - 2022-08-21
4
26
 
data/Gemfile CHANGED
@@ -10,3 +10,4 @@ gem "rake", "~> 13.0"
10
10
  gem "minitest", "~> 5.0"
11
11
 
12
12
  gem "rubocop", "~> 1.21"
13
+ gem "logger"
data/Gemfile.lock CHANGED
@@ -6,39 +6,80 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.2)
10
- json (2.6.2)
11
- minitest (5.16.3)
12
- parallel (1.22.1)
13
- parser (3.1.2.1)
9
+ ast (2.4.3)
10
+ ffi (1.17.3)
11
+ ffi (1.17.3-aarch64-linux-gnu)
12
+ ffi (1.17.3-aarch64-linux-musl)
13
+ ffi (1.17.3-arm-linux-gnu)
14
+ ffi (1.17.3-arm-linux-musl)
15
+ ffi (1.17.3-arm64-darwin)
16
+ ffi (1.17.3-x86-linux-gnu)
17
+ ffi (1.17.3-x86-linux-musl)
18
+ ffi (1.17.3-x86_64-darwin)
19
+ ffi (1.17.3-x86_64-linux-gnu)
20
+ ffi (1.17.3-x86_64-linux-musl)
21
+ json (2.15.2)
22
+ language_server-protocol (3.17.0.5)
23
+ lint_roller (1.1.0)
24
+ listen (3.9.0)
25
+ rb-fsevent (~> 0.10, >= 0.10.3)
26
+ rb-inotify (~> 0.9, >= 0.9.10)
27
+ logger (1.7.0)
28
+ minitest (5.27.0)
29
+ parallel (1.27.0)
30
+ parser (3.3.10.0)
14
31
  ast (~> 2.4.1)
32
+ racc
33
+ prism (1.6.0)
34
+ racc (1.8.1)
15
35
  rainbow (3.1.1)
16
- rake (13.0.6)
17
- regexp_parser (2.5.0)
18
- rexml (3.2.5)
19
- rubocop (1.35.0)
36
+ rake (13.3.1)
37
+ rb-fsevent (0.11.2)
38
+ rb-inotify (0.11.1)
39
+ ffi (~> 1.0)
40
+ regexp_parser (2.11.3)
41
+ rubocop (1.81.7)
20
42
  json (~> 2.3)
43
+ language_server-protocol (~> 3.17.0.2)
44
+ lint_roller (~> 1.1.0)
21
45
  parallel (~> 1.10)
22
- parser (>= 3.1.2.1)
46
+ parser (>= 3.3.0.2)
23
47
  rainbow (>= 2.2.2, < 4.0)
24
- regexp_parser (>= 1.8, < 3.0)
25
- rexml (>= 3.2.5, < 4.0)
26
- rubocop-ast (>= 1.20.1, < 2.0)
48
+ regexp_parser (>= 2.9.3, < 3.0)
49
+ rubocop-ast (>= 1.47.1, < 2.0)
27
50
  ruby-progressbar (~> 1.7)
28
- unicode-display_width (>= 1.4.0, < 3.0)
29
- rubocop-ast (1.21.0)
30
- parser (>= 3.1.1.0)
31
- ruby-progressbar (1.11.0)
32
- unicode-display_width (2.2.0)
51
+ unicode-display_width (>= 2.4.0, < 4.0)
52
+ rubocop-ast (1.47.1)
53
+ parser (>= 3.3.7.2)
54
+ prism (~> 1.4)
55
+ ruby-progressbar (1.13.0)
56
+ sassc (2.4.0)
57
+ ffi (~> 1.9)
58
+ unicode-display_width (3.2.0)
59
+ unicode-emoji (~> 4.1)
60
+ unicode-emoji (4.2.0)
33
61
 
34
62
  PLATFORMS
35
- arm64-darwin-20
63
+ aarch64-linux-gnu
64
+ aarch64-linux-musl
65
+ arm-linux-gnu
66
+ arm-linux-musl
67
+ arm64-darwin
68
+ ruby
69
+ x86-linux-gnu
70
+ x86-linux-musl
71
+ x86_64-darwin
72
+ x86_64-linux-gnu
73
+ x86_64-linux-musl
36
74
 
37
75
  DEPENDENCIES
76
+ listen
77
+ logger
38
78
  minitest (~> 5.0)
39
79
  murb_design_system!
40
80
  rake (~> 13.0)
41
81
  rubocop (~> 1.21)
82
+ sassc
42
83
 
43
84
  BUNDLED WITH
44
- 2.2.29
85
+ 2.5.11
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # MurbDesignSystem
1
+ # murb design system
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/murb_design_system`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A very basic and bare bones system of components that will be used for [murb](https://murb.nl)'s non-marketing / more app type projects.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ A preview can be shown here: [the latest auto deployed preview](https://murb-org.gitlab.io/murb-design-system/)
6
6
 
7
7
  ## Installation
8
8
 
@@ -12,6 +12,13 @@ Add this line to your application's Gemfile:
12
12
  gem 'murb_design_system'
13
13
  ```
14
14
 
15
+ Or if you want to live on the edge:
16
+
17
+
18
+ ```ruby
19
+ gem 'murb_design_system', git: "https://gitlab.com/murb-org/murb-design-system.git"
20
+ ```
21
+
15
22
  And then execute:
16
23
 
17
24
  $ bundle install
@@ -20,14 +27,13 @@ Or install it yourself as:
20
27
 
21
28
  $ gem install murb_design_system
22
29
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
30
 
27
31
  ## Development
28
32
 
29
33
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
34
 
35
+ To add or change styles, use `bin/watch` (which uses the listen gem to auto build) or just the one-time `bin/build`
36
+
31
37
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
38
 
33
39
  ## Contributing
@@ -41,3 +47,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
41
47
  ## Code of Conduct
42
48
 
43
49
  Everyone interacting in the MurbDesignSystem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/murb_design_system/blob/main/CODE_OF_CONDUCT.md).
50
+
51
+ ## Alternatives
52
+
53
+ * [SimpleCSS](https://simplecss.org/simple-css-version-2)
@@ -0,0 +1,15 @@
1
+ <nav class="sticky" aria-label="Primary">
2
+ <ul>
3
+ <li><a href="./index.html" class="active">Home</a></li>
4
+ <li><a href="./basis.html">Basis</a></li>
5
+ <li><a href="./navigation.html">Navigation</a></li>
6
+ <li><a href="./blocks.html">Blocks</a></li>
7
+ <li><a href="./print.html">Print</a></li>
8
+ <li><a href="./layout.html">Layout</a></li>
9
+ <li><a href="./promo.html">Promo</a></li>
10
+ </ul>
11
+
12
+ <ul>
13
+ <li><a href="javascript:alert('yea');" class="button alert">Fake sign out button</a></li>
14
+ </ul>
15
+ </nav>
data/basis.html.erb ADDED
@@ -0,0 +1,340 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8
+ <link rel="stylesheet" href="dist/murb_design_system.css">
9
+
10
+ <title>murb design system</title>
11
+ <% if ENV['REFRESH'] %>
12
+ <meta http-equiv="refresh" content="<%=ENV['REFRESH'] %>">
13
+ <% end %>
14
+
15
+ </head>
16
+
17
+ <body>
18
+ <%= File.read("_navigation.html.erb") %>
19
+ <main>
20
+ <h1 id="intro">The Basis</h1>
21
+ <p>Examples of how regular HTML elements are styled</p>
22
+
23
+ <section id="headers" class="visual-comparison-block">
24
+ <h2>Headers</h2>
25
+
26
+ <p>You've already come accross <code>h1</code> and <code>h2</code></p>
27
+
28
+ <h3>Level 3</h3>
29
+
30
+ <h4>Level 4</h4>
31
+
32
+ <h5>Level 5</h5>
33
+
34
+ <h6>Level 6</h6>
35
+
36
+ <p>Note we also have article display; these headers are a tad bit nicer.</p>
37
+
38
+ <p>Links on headers don't get additional colouring</p>
39
+
40
+ <h3><a href="#">A linking h3</a></h3>
41
+ </section>
42
+
43
+
44
+ <section id="lists" class="visual-comparison-block">
45
+ <h2 id="lists">Lists</h2>
46
+ <p>Just use regular HTML</p>
47
+ <h3>Unordered lists</h3>
48
+ <ul>
49
+ <li>Use semantic HTML and rely on it <em>without using additional classes</em></li>
50
+ <li>Do not reset the browser stylesheets (there might be a reason for it)</li>
51
+ <li>...</li>
52
+ </ul>
53
+ <p>There is a variant of this list, called <code>.labels</code>, just add the class to the <code>ul</code> to present a list of labels (or tags if you wish):</p>
54
+ <ul class="labels">
55
+ <li>Tag</li>
56
+ <li><a href="#lists">Linked tag</a></li>
57
+ </ul>
58
+ <p>If you need them more flexibly, there is also the <code>.label</code> class so you can
59
+ <span class="label">use</span>
60
+ <span class="label">this</span>
61
+ <span class="label">style</span>
62
+ <span class="label">inside</span>
63
+ a sentence. I don't like this solution as much as there is no semantics attached, but it could perhaps be derived from the content.</p>
64
+
65
+ <h3>Ordered lists</h3>
66
+ <ol>
67
+ <li>Use semantic HTML and rely on it <em>without using additional classes</em></li>
68
+ <li>Do not reset the browser stylesheets (there might be a reason for it)</li>
69
+ <li>...</li>
70
+ </ol>
71
+ <h3>Definition lists</h3>
72
+ <dl>
73
+ <dt>CSS</dt>
74
+ <dd>Cascading Style Sheets</dd>
75
+ <dt>HTML</dt>
76
+ <dd>HyperText Markup Language</dd>
77
+ </dl>
78
+ <p>The above is basically unstyled. You can add a <code>.no-inset</code> class to remove the default padding. A slight bottom margin is added to keep the visual grouping</p>
79
+ <dl class="no-inset">
80
+ <dt>CSS</dt>
81
+ <dd>Cascading Style Sheets</dd>
82
+ <dt>HTML</dt>
83
+ <dd>HyperText Markup Language</dd>
84
+ </dl>
85
+ <p>Finally, you there is an inline variant, where the dt and dd are displayed inline. This is done by adding a <code>.inline</code> class to the dl-element.</p>
86
+ <dl class="inline">
87
+ <dt>CSS</dt>
88
+ <dd>Cascading Style Sheets. Also here we add a small bottom margin to make sure that even when the text is very long, like this, there is some visual grouping.</dd>
89
+ <dt>HTML</dt>
90
+ <dd>HyperText Markup Language</dd>
91
+ </dl>
92
+
93
+ </section>
94
+ <section id="images" class="visual-comparison-block">
95
+ <h2>Images</h2>
96
+ <h3>Figure with a figcaption</h3>
97
+ <p>
98
+ <figure>
99
+ <img src="dist/GLOBE---1850-2024-MO.png" alt="stripes showing temperature rise from 1850 till 2024; blue is cooler; red is warmer, dark red is warmest; rising temperature is made absolutely clear from left to right" title="Warming Strips 1850-2024 for the globe provided by #ShowYourStripes, data by UK MetOffice" />
100
+ <figcaption>Warming Strips 1850-2024 for the globe provided by #ShowYourStripes, data by UK MetOffice</figcaption>
101
+ </figure>
102
+ </p>
103
+ <p>Note, this also works in article view, see below.</p>
104
+ </section>
105
+ <section id="forms" class="visual-comparison-block">
106
+ <h2 >Forms</h2>
107
+ <form>
108
+ <label>This is a label with the input inside it.<input type="text" /></label>
109
+ <label>This is a label with the input inside it.<input type="text" aria-invalid="true" /><span class="error">with
110
+ an error</span></label>
111
+ <label for="uniqueInputId">Label and input NOT nested</label>
112
+ <input type="text" id="uniqueInputId" />
113
+ <label>Date input, just use HTML5 inputs.<input type="date" /></label>
114
+ <label>A disabled number input.<input type="number" disabled="disabled" /></label>
115
+ <label>We cab also have a hint<input type="number" disabled="disabled" /></label>
116
+ <p class="hint">This field is disabled because it has the disabled property set</p>
117
+ <label>Textarea.<textarea>Some text</textarea></label>
118
+ <label>A .large textarea<textarea class="large">Some text</textarea></label>
119
+ <fieldset>
120
+ <legend>Buttons</legend>
121
+ <p>These buttons are indeed presented within a fieldset</p>
122
+ <input type="submit" value="Plain submit button" />
123
+ <button>A button</button>
124
+ <a href="" class="button">A link with a button class</a>
125
+ <br />
126
+ <a href="" class="small button">.button.small</a>
127
+ <button class="small">A button-element with just a small class</button>
128
+ <small><button>Button-element within a small-element container</button></small>
129
+ <br />
130
+ <button class="warn">add .warn</button>
131
+ <button class="secondary">add .secondary</button>
132
+ <button class="primary">add .primary</button>
133
+
134
+ </fieldset>
135
+ <h3>Selecting one or more from a list of variables</h3>
136
+ <p>We use a option select if there is more than > 8 options to present.</p>
137
+
138
+ <label>Option select<select>
139
+ <option>Default</option>
140
+ <option>Other</option>
141
+ <option>Yet another</option>
142
+ </select></label>
143
+ <fieldset>
144
+ <legend>Radiobuttons</legend>
145
+ <label><input type="radio" name="radio" />Option 1</label>
146
+ <label><input type="radio" name="radio" />Option 2</label>
147
+ <label><input type="radio" name="radio" />Option 3</label>
148
+ <p>Non nested:</p>
149
+ <input type="radio" name="radio" id="nonnestedradio1" /><label for="nonnestedradio1">Option 1</label>
150
+ <input type="radio" name="radio" id="nonnestedradio2" /><label for="nonnestedradio2">Option 1</label>
151
+ <input type="radio" name="radio" id="nonnestedradio3" /><label for="nonnestedradio3">Option 1</label>
152
+ </fieldset>
153
+ <fieldset>
154
+ <legend>Checkboxes</legend>
155
+ <label><input type="checkbox" name="check" />Option 1</label>
156
+ <label><input type="checkbox" name="check" />Option 2</label>
157
+ <label><input type="checkbox" name="check" />Option 3</label>
158
+ <p>Non nested:</p>
159
+ <input type="checkbox" name="check" id="nonnestedcheckbox1" /><label for="nonnestedcheckbox1">Option 1</label>
160
+ <input type="checkbox" name="check" id="nonnestedcheckbox2" /><label for="nonnestedcheckbox2">Option 2</label>
161
+ <input type="checkbox" name="check" id="nonnestedcheckbox3" /><label for="nonnestedcheckbox3">Option 3</label>
162
+ </fieldset>
163
+ </form>
164
+ <p>Note we do a few nice things, this is a form (but invisible)</p>
165
+ <form>
166
+ <h2>This doesn't get top margin</h2>
167
+ <h2>This does</h2>
168
+ </form>
169
+ </section>
170
+
171
+
172
+ <section id="tables" class="visual-comparison-block">
173
+ <h2>Tables</h2>
174
+ <table>
175
+ <thead>
176
+ <tr>
177
+ <th>Head</th>
178
+ <th class="number">Other<br/>head</th>
179
+ </tr>
180
+ </thead>
181
+ <tfoot>
182
+ <tr>
183
+ <td>Foot</td>
184
+ <td class="number"><strong>€ 12335.00</strong></td>
185
+ </tr>
186
+ <tbody>
187
+ <tr>
188
+ <th>Number next <br/><small>(with .number class)</small></th>
189
+ <td class="number">€ 12.00</td>
190
+ </tr>
191
+ <tr>
192
+ <th>Other number (with .number class)</th>
193
+ <td class="number">€ 12323.00</td>
194
+ </tr>
195
+ </tbody>
196
+ </table>
197
+
198
+ <h3>Sorting tables</h3>
199
+ <p>When applying <code>aria-sort="ascending"</code> or <code>aria-sort="descending"</code> (see <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort">MDN on Aria Sort</a>) you get automatic content after</p>
200
+ <table>
201
+ <thead>
202
+ <tr>
203
+ <th aria-sort="ascending">Ascending</th>
204
+ <th aria-sort="descending">Descending</th>
205
+ </tr>
206
+ </thead>
207
+ </table>
208
+ </section>
209
+
210
+ <section id="other-text-blocks" class="visual-comparison-block">
211
+
212
+ <section>I'm writing this in a section containing a section, hence the super section has a small line on top :)</section>
213
+ <h2>Other text blocks</h2>
214
+ <h3>Just `pre`</h3>
215
+ <pre>The MIT License (MIT)
216
+
217
+ Copyright © 2025
218
+
219
+
220
+ Permission is hereby granted, free of charge, to any person obtaining a copy
221
+ of this software and associated documentation files (the “Software”), to deal
222
+ in the Software without restriction, including without limitation the rights
223
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
224
+ copies of the Software, and to permit persons to whom the Software is
225
+ furnished to do so, subject to the following conditions:
226
+
227
+ The above copyright notice and this permission notice shall be included in
228
+ all copies or substantial portions of the Software.
229
+
230
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
231
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
232
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
233
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
234
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
235
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
236
+ THE SOFTWARE.</pre>
237
+ <h3>A code block `pre > code`</h3>
238
+ <pre><code># My favourite programming language is ruby
239
+
240
+ def say(what)
241
+ puts what || ["Euh", "Ah", "..."].sample
242
+ end
243
+
244
+ 10.times { say "Hello!" } # prints Hello! 10 times :)
245
+ 10.times { say } # prints randomly one of the texts "Euh", "Ah" ...</code></pre>
246
+ <small>Aside: I have some concerns about ruby and its climate impact, but there are multiple ways to make delivery more efficient. Caching is one of them.</small>
247
+ <h3>Inline code</h3>
248
+ <p>Sometimes you just want to say that a method called <code>puts</code> writes something to the screen.</p>
249
+ <h3>Blockquote</h3>
250
+ <p>Friday's for future, which started with Greta Thunberg's weekly strike works towards the following goals</p>
251
+
252
+ <blockquote cite="https://fridaysforfuture.org/what-we-do/our-demands/">
253
+ <ol><li>Keep the global temperature rise below 1.5 °C compared to pre-industrial levels. </li>
254
+ <li>Ensure climate justice and equity.</li>
255
+ <li>Listen to the best united science currently available.</li></ol>
256
+ </blockquote>
257
+
258
+ <blockquote cite="https://fridaysforfuture.org/what-we-do/our-demands/">
259
+ <ol><li>Keep the global temperature rise below 1.5 °C compared to pre-industrial levels. </li>
260
+ <li>Ensure climate justice and equity.</li>
261
+ <li>Listen to the best united science currently available.</li></ol>
262
+ </blockquote>
263
+
264
+ <p>We can present this a bit nicer using a figure block</p>
265
+
266
+ <figure class="quote">
267
+ <blockquote cite="https://fridaysforfuture.org/what-we-do/our-demands/">
268
+ <ol><li>Keep the global temperature rise below 1.5 °C compared to pre-industrial levels. </li>
269
+ <li>Ensure climate justice and equity.</li>
270
+ <li>Listen to the best united science currently available.</li></ol> </blockquote>
271
+ <figcaption><cite><a href="https://fridaysforfuture.org/what-we-do/our-demands/">Declaration of Lausanne</a></cite> | August 2019, 400 climate activists from 38 countries</figcaption>
272
+ </figure>
273
+
274
+ <p>Sometimes the quote quotes a quote</p>
275
+
276
+ <figure class="quote">
277
+ <blockquote cite="https://fridaysforfuture.org/what-we-do/our-demands/">
278
+ <ol><li>Keep the global temperature rise below 1.5 °C compared to pre-industrial levels. </li>
279
+ <li>Ensure climate justice and equity.</li>
280
+ <li>Listen to the best united science currently available.</li></ol>
281
+
282
+ <figure class="quote">
283
+ <blockquote cite="https://fridaysforfuture.org/what-we-do/our-demands/">
284
+ <ol><li>Keep the global temperature rise below 1.5 °C compared to pre-industrial levels. </li>
285
+ <li>Ensure climate justice and equity.</li>
286
+ <li>Listen to the best united science currently available.</li></ol> </blockquote>
287
+ <figcaption><cite><a href="https://fridaysforfuture.org/what-we-do/our-demands/">Declaration of Lausanne</a></cite> | August 2019, 400 climate activists from 38 countries</figcaption>
288
+ </figure>
289
+
290
+ </blockquote>
291
+ <figcaption><cite><a href="https://fridaysforfuture.org/what-we-do/our-demands/">Declaration of Lausanne</a></cite> | August 2019, 400 climate activists from 38 countries</figcaption>
292
+ </figure>
293
+
294
+ <aside>An <code>aside</code> in a section within main gets a grey background to make it more distinct from the running text</aside>
295
+
296
+
297
+ </section>
298
+ <footer>
299
+ Any page can have a footer, right?
300
+ </footer>
301
+
302
+
303
+ <h2>Visual comparison</h2>
304
+
305
+ <div id="outputCanvas"></div>
306
+
307
+ <script src="html2canvas.min.js"></script>
308
+
309
+ <script>
310
+ container = document.getElementById("outputCanvas")
311
+ document.querySelectorAll(".visual-comparison-block").forEach(element => {
312
+ const header = document.createElement("h3");
313
+
314
+ const headerText = document.createTextNode(element.id);
315
+ header.appendChild(headerText);
316
+
317
+ html2canvas(element).then(canvas => {
318
+
319
+ container.appendChild(header);
320
+ container.appendChild(canvas);
321
+ const link = document.createElement("a");
322
+ const linkText = document.createTextNode("Download " + element.id);
323
+ setTimeout(() => {
324
+ const linkTarget = canvas.toDataURL();
325
+ link.href = linkTarget;
326
+ link.appendChild(linkText);
327
+ link.setAttribute("download", element.id + ".png");
328
+ container.appendChild(link);
329
+ }, 100);
330
+
331
+ });
332
+ });
333
+
334
+
335
+
336
+ </script>
337
+
338
+ </body>
339
+
340
+ </html>
data/bin/build ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "murb_design_system"
6
+ require "sassc"
7
+ require "erb"
8
+
9
+ stylesheets_path = File.expand_path("../../vendor/assets/stylesheets", __FILE__)
10
+ root_path = File.expand_path("../..", __FILE__)
11
+
12
+ SassC.load_paths << stylesheets_path
13
+
14
+ Dir.mkdir File.join(root_path, "public") rescue Errno::EEXIST
15
+ Dir.mkdir File.join(root_path, "public", "dist") rescue Errno::EEXIST
16
+ scss_file_names = Dir.glob(File.join(stylesheets_path,"*.scss"))
17
+
18
+ output = scss_file_names.flat_map do |scss_file_name|
19
+ ["/* #{scss_file_name} */\n",SassC::Engine.new(File.open(scss_file_name).read).render]
20
+ end.join("\n")
21
+
22
+ File.write(File.join(root_path, "dist/murb_design_system.css"), output)
23
+ File.write(File.join(root_path, "dist/murb_design_system.min.css"), SassC::Engine.new(output, style: :compressed).render)
24
+ File.write(File.join(root_path, "public/dist/murb_design_system.css"), output)
25
+ File.write(File.join(root_path, "public/dist/murb_design_system.min.css"), SassC::Engine.new(output, style: :compressed).render)
26
+
27
+
28
+ erb_file_names = Dir.glob(File.join(root_path,"*.html.erb"))
29
+ erb_file_names.each do |erb_file|
30
+ unless erb_file.to_s.match("/_")
31
+ index_html = ERB.new(File.read(erb_file)).result
32
+ file_name = erb_file.split("/").last
33
+
34
+ # binding.irb
35
+ File.write(File.join(root_path, "public", file_name.sub("html.erb","html")), index_html)
36
+ end
37
+ end
38
+
39
+
40
+ # require "irb"
41
+ # IRB.start(__FILE__)
data/bin/watch ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "murb_design_system"
6
+ require 'listen'
7
+
8
+ root_path = File.expand_path("../..", __FILE__)
9
+
10
+ `#{File.join(root_path, 'bin', 'build')}`
11
+
12
+ listener = Listen.to(root_path) do |modified, added, removed|
13
+ puts "Change picked up @ #{Time.now}"
14
+ # puts "modified"
15
+ hash = {modified: modified}
16
+ puts hash
17
+ `#{File.join(root_path, 'bin', 'build')}`
18
+ end
19
+
20
+ # don't loop
21
+ listener.ignore(/dist/)
22
+ listener.ignore(/\.html$/)
23
+
24
+ listener.start
25
+ sleep