decidim-design 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +29 -0
  3. data/Rakefile +3 -0
  4. data/app/controllers/concerns/decidim/design/has_templates.rb +20 -0
  5. data/app/controllers/decidim/design/application_controller.rb +28 -0
  6. data/app/controllers/decidim/design/components_controller.rb +21 -0
  7. data/app/controllers/decidim/design/foundations_controller.rb +14 -0
  8. data/app/controllers/decidim/design/home_controller.rb +11 -0
  9. data/app/helpers/decidim/design/activities_helper.rb +65 -0
  10. data/app/helpers/decidim/design/address_helper.rb +59 -0
  11. data/app/helpers/decidim/design/announcement_helper.rb +73 -0
  12. data/app/helpers/decidim/design/application_helper.rb +100 -0
  13. data/app/helpers/decidim/design/author_helper.rb +91 -0
  14. data/app/helpers/decidim/design/buttons_helper.rb +148 -0
  15. data/app/helpers/decidim/design/cards_helper.rb +195 -0
  16. data/app/helpers/decidim/design/colors_helper.rb +96 -0
  17. data/app/helpers/decidim/design/follow_helper.rb +42 -0
  18. data/app/helpers/decidim/design/iconography_helper.rb +72 -0
  19. data/app/helpers/decidim/design/report_helper.rb +38 -0
  20. data/app/helpers/decidim/design/share_helper.rb +38 -0
  21. data/app/helpers/decidim/design/tab_panels_helper.rb +103 -0
  22. data/app/helpers/decidim/design/typography_helper.rb +112 -0
  23. data/app/packs/entrypoints/decidim_design.js +2 -0
  24. data/app/packs/stylesheets/design.scss +121 -0
  25. data/app/views/decidim/design/components/accordions.html.erb +66 -0
  26. data/app/views/decidim/design/components/activities/_static-activities.html.erb +79 -0
  27. data/app/views/decidim/design/components/activities/_static-activity.html.erb +56 -0
  28. data/app/views/decidim/design/components/activities.html.erb +11 -0
  29. data/app/views/decidim/design/components/address/_static-address-online.html.erb +9 -0
  30. data/app/views/decidim/design/components/address/_static-address-person.html.erb +8 -0
  31. data/app/views/decidim/design/components/address.html.erb +11 -0
  32. data/app/views/decidim/design/components/announcement.html.erb +11 -0
  33. data/app/views/decidim/design/components/author/_static-avatar.html.erb +38 -0
  34. data/app/views/decidim/design/components/author/_static-compact.html.erb +46 -0
  35. data/app/views/decidim/design/components/author/_static-default.html.erb +35 -0
  36. data/app/views/decidim/design/components/author.html.erb +11 -0
  37. data/app/views/decidim/design/components/buttons.html.erb +15 -0
  38. data/app/views/decidim/design/components/cards/_static-card-g-highlight.html.erb +18 -0
  39. data/app/views/decidim/design/components/cards/_static-card-g-metadata-2.html.erb +17 -0
  40. data/app/views/decidim/design/components/cards/_static-card-g-metadata.html.erb +14 -0
  41. data/app/views/decidim/design/components/cards/_static-card-g.html.erb +17 -0
  42. data/app/views/decidim/design/components/cards/_static-card-l-description.html.erb +28 -0
  43. data/app/views/decidim/design/components/cards/_static-card-l-extra-data-2.html.erb +31 -0
  44. data/app/views/decidim/design/components/cards/_static-card-l-extra-data.html.erb +16 -0
  45. data/app/views/decidim/design/components/cards/_static-card-l-image.html.erb +66 -0
  46. data/app/views/decidim/design/components/cards/_static-card-l-meetings.html.erb +30 -0
  47. data/app/views/decidim/design/components/cards/_static-card-l.html.erb +60 -0
  48. data/app/views/decidim/design/components/cards/_static-card-s.html.erb +15 -0
  49. data/app/views/decidim/design/components/cards.html.erb +11 -0
  50. data/app/views/decidim/design/components/dialogs.html.erb +89 -0
  51. data/app/views/decidim/design/components/dropdowns.html.erb +64 -0
  52. data/app/views/decidim/design/components/follow/_static-follow-default.html.erb +4 -0
  53. data/app/views/decidim/design/components/follow/_static-follow-unfollow.html.erb +4 -0
  54. data/app/views/decidim/design/components/follow.html.erb +11 -0
  55. data/app/views/decidim/design/components/forms.html.erb +235 -0
  56. data/app/views/decidim/design/components/report/_static-report.html.erb +34 -0
  57. data/app/views/decidim/design/components/report.html.erb +11 -0
  58. data/app/views/decidim/design/components/share.html.erb +11 -0
  59. data/app/views/decidim/design/components/tab_panels.html.erb +11 -0
  60. data/app/views/decidim/design/foundations/accessibility.html.erb +99 -0
  61. data/app/views/decidim/design/foundations/color/_table.html.erb +26 -0
  62. data/app/views/decidim/design/foundations/color.html.erb +16 -0
  63. data/app/views/decidim/design/foundations/iconography/_icons.html.erb +8 -0
  64. data/app/views/decidim/design/foundations/iconography.html.erb +16 -0
  65. data/app/views/decidim/design/foundations/layout.html.erb +128 -0
  66. data/app/views/decidim/design/foundations/typography.html.erb +15 -0
  67. data/app/views/decidim/design/home/index.html.erb +17 -0
  68. data/app/views/decidim/design/shared/_card_grid.html.erb +3 -0
  69. data/app/views/decidim/design/shared/_cell_snippet.html.erb +6 -0
  70. data/app/views/decidim/design/shared/_sections.html.erb +9 -0
  71. data/app/views/decidim/design/shared/_table.html.erb +12 -0
  72. data/app/views/layouts/decidim/design/_head.html.erb +5 -0
  73. data/app/views/layouts/decidim/design/_layout.html.erb +86 -0
  74. data/app/views/layouts/decidim/design/application.html.erb +15 -0
  75. data/config/assets.rb +8 -0
  76. data/config/routes.rb +10 -0
  77. data/lib/decidim/design/engine.rb +35 -0
  78. data/lib/decidim/design/version.rb +9 -0
  79. data/lib/decidim/design.rb +10 -0
  80. metadata +154 -0
@@ -0,0 +1,235 @@
1
+ <% content_for :heading do %>
2
+ <%= cell "decidim/announcement", "This page comes from a legacy view. Content is outdated.", callout_class: "alert" %>
3
+ Forms
4
+ <% end %>
5
+
6
+ <% content_for :toc do %>
7
+ <a href="#common">HTML regular inputs</a>
8
+ <a href="#helps">Help texts</a>
9
+ <a href="#disabled">Disabled</a>
10
+ <a href="#error">Errors</a>
11
+ <a href="#length">Min/Max length</a>
12
+ <a href="#emoji">Emojis</a>
13
+ <% end %>
14
+
15
+ <%
16
+ text_types = [
17
+ "date",
18
+ # "datetime-local",
19
+ # "email",
20
+ # "month",
21
+ "number",
22
+ "password",
23
+ # "search",
24
+ # "tel",
25
+ "text"
26
+ # "time",
27
+ # "url",
28
+ # "week"
29
+ ]
30
+
31
+ options_types = %w(checkbox radio)
32
+ %>
33
+
34
+ <section id="common-panel" class="design__section">
35
+ <h2 class="h2">HTML regular inputs</h2>
36
+
37
+ <div class="form__wrapper">
38
+ <%= cell "decidim/announcement", "Only displays common types, full available list: date, datetime-local, email, month, number, password, search, tel, text, time, url, week" %>
39
+
40
+ <% text_types.each do |element| %>
41
+ <label>
42
+ input type="<%= element %>"
43
+ <input type="<%= element %>">
44
+ </label>
45
+ <% end %>
46
+
47
+ <% options_types.each do |element| %>
48
+ <fieldset>
49
+ <legend>fieldset [legend]</legend>
50
+
51
+ <% 3.times do |i| %>
52
+ <label class="form__wrapper-checkbox-label">
53
+ <input type="<%= element %>">
54
+ input type="<%= element %>"
55
+ </label>
56
+ <% end %>
57
+ </fieldset>
58
+ <% end %>
59
+
60
+ <label>
61
+ textarea
62
+ <textarea cols="30" rows="10"></textarea>
63
+ </label>
64
+
65
+ <label>
66
+ select
67
+ <select>
68
+ <% 3.times do |i| %>
69
+ <option value="<%= i %>">option <%= i %></option>
70
+ <% end %>
71
+ </select>
72
+ </label>
73
+ </div>
74
+ </section>
75
+
76
+ <section id="helps" class="design__section">
77
+ <h2 class="h2">Help texts</h2>
78
+
79
+ <div class="form__wrapper">
80
+ <% text_types.each do |element| %>
81
+ <label>
82
+ input type="<%= element %>"
83
+ <span class="help-text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos hic quos omnis vero aspernatur architecto!</span>
84
+ <input type="<%= element %>">
85
+ </label>
86
+ <% end %>
87
+
88
+ <% options_types.each do |element| %>
89
+ <fieldset>
90
+ <legend>fieldset [legend]</legend>
91
+ <span class="help-text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos hic quos omnis vero aspernatur architecto!</span>
92
+
93
+ <% 3.times do |i| %>
94
+ <label class="form__wrapper-checkbox-label">
95
+ <input type="<%= element %>">
96
+ input type="<%= element %>"
97
+ </label>
98
+ <% end %>
99
+ </fieldset>
100
+ <% end %>
101
+
102
+ <label>
103
+ textarea
104
+ <span class="help-text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos hic quos omnis vero aspernatur architecto!</span>
105
+ <textarea cols="30" rows="10"></textarea>
106
+ </label>
107
+
108
+ <label>
109
+ select
110
+ <span class="help-text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos hic quos omnis vero aspernatur architecto!</span>
111
+ <select>
112
+ <% 3.times do |i| %>
113
+ <option value="<%= i %>">option <%= i %></option>
114
+ <% end %>
115
+ </select>
116
+ </label>
117
+ </div>
118
+ </section>
119
+
120
+ <section id="disabled" class="design__section">
121
+ <h2 class="h2">Disabled</h2>
122
+
123
+ <div class="form__wrapper">
124
+ <% text_types.each do |element| %>
125
+ <label>
126
+ input type="<%= element %>" disabled
127
+ <input type="<%= element %>" disabled>
128
+ </label>
129
+ <% end %>
130
+
131
+ <% options_types.each do |element| %>
132
+ <fieldset>
133
+ <legend>fieldset [legend]</legend>
134
+
135
+ <% 3.times do |i| %>
136
+ <label class="form__wrapper-checkbox-label">
137
+ <input type="<%= element %>" disabled>
138
+ input type="<%= element %>" disabled
139
+ </label>
140
+ <% end %>
141
+ </fieldset>
142
+ <% end %>
143
+
144
+ <label>
145
+ textarea disabled
146
+ <textarea cols="30" rows="10" disabled></textarea>
147
+ </label>
148
+
149
+ <label>
150
+ select disabled
151
+ <select disabled>
152
+ <% 3.times do |i| %>
153
+ <option value="<%= i %>">option <%= i %></option>
154
+ <% end %>
155
+ </select>
156
+ </label>
157
+ </div>
158
+ </section>
159
+
160
+ <section id="error" class="design__section">
161
+ <h2 class="h2">Errors</h2>
162
+
163
+ <div class="form__wrapper">
164
+ <%= cell "decidim/announcement", "Does not apply for select" %>
165
+
166
+ <% text_types.each do |element| %>
167
+ <label>
168
+ input type="<%= element %>" required
169
+ <input type="<%= element %>" required>
170
+ <div class="form-error">Lorem ipsum dolor sit amet.</div>
171
+ </label>
172
+ <% end %>
173
+
174
+ <% options_types.each do |element| %>
175
+ <fieldset>
176
+ <legend>fieldset [legend]</legend>
177
+ <div class="form-error">Lorem ipsum dolor sit amet.</div>
178
+
179
+ <% 3.times do |i| %>
180
+ <label class="form__wrapper-checkbox-label">
181
+ <input type="<%= element %>">
182
+ input type="<%= element %>"
183
+ </label>
184
+ <% end %>
185
+ </fieldset>
186
+ <% end %>
187
+
188
+ <label>
189
+ textarea required
190
+ <textarea cols="30" rows="10" required></textarea>
191
+ <div class="form-error">Lorem ipsum dolor sit amet.</div>
192
+ </label>
193
+ </div>
194
+ </section>
195
+
196
+ <section id="length" class="design__section">
197
+ <h2 class="h2">Min/Max length</h2>
198
+
199
+ <div class="form__wrapper">
200
+ <%= cell "decidim/announcement", "Only works for input type='text' and textarea" %>
201
+
202
+ <label>
203
+ input type="text" maxlength="20"
204
+ <input type="text" maxlength="20">
205
+ </label>
206
+
207
+ <label>
208
+ textarea maxlength="20"
209
+ <textarea cols="30" rows="10" maxlength="20"></textarea>
210
+ </label>
211
+
212
+ <label>
213
+ input type="text" minlength="5" maxlength="20"
214
+ <input type="text" minlength="5" maxlength="20">
215
+ </label>
216
+
217
+ <label>
218
+ textarea minlength="5" maxlength="20"
219
+ <textarea cols="30" rows="10" minlength="5" maxlength="20"></textarea>
220
+ </label>
221
+ </div>
222
+ </section>
223
+
224
+ <section id="emoji" class="design__section">
225
+ <h2 class="h2">Emojis</h2>
226
+
227
+ <div class="form__wrapper">
228
+ <%= cell "decidim/announcement", "Only works for textarea" %>
229
+
230
+ <label>
231
+ textarea data-input-emoji="true"
232
+ <textarea cols="30" rows="10" data-input-emoji="true"></textarea>
233
+ </label>
234
+ </div>
235
+ </section>
@@ -0,0 +1,34 @@
1
+ <button class="button button__sm button__text button__text-secondary" title="Report" data-dialog-open="flagModal" aria-haspopup="dialog">
2
+ <span>Report</span>
3
+ <%= icon("flag-line") %>
4
+ </button>
5
+
6
+ <div id="flagModal" data-dialog="flagModal" role="dialog" tabindex="-1" aria-hidden="false" aria-labelledby="dialog-title-flagModal" aria-describedby="dialog-desc-flagModal" aria-modal="true">
7
+ <div id="flagModal-content" class="flag-modal">
8
+ <button type="button" data-dialog-close="flagModal" data-dialog-closable="" aria-label="Close modal">×</button>
9
+ <form class="new_report" action="#" accept-charset="UTF-8" method="post">
10
+ <input type="hidden" name="authenticity_token" value="Cw1tZf21dYDKeZ7MWIfUDHYzVeEYdaMhHAyPq4VcDeuqS-WbBQWx0srwBGXqlnq3kDAmSMFSTHrcDTxM0rq_Ig" autocomplete="off">
11
+ <div data-dialog-container="">
12
+ <%= icon("flag-line") %>
13
+ <h2 id="dialog-title-flagModal" tabindex="-1" data-dialog-title="">Report inappropriate content</h2>
14
+ <div>
15
+ <div class="form__wrapper flag-modal__form">
16
+ <p id="dialog-desc-flagModal" class="flag-modal__form-description">Is this content inappropriate?</p>
17
+ <p class="flag-modal__form-reason">Reason:</p>
18
+ <input type="hidden" name="report[reason]" value="" autocomplete="off"><label class="form__wrapper-checkbox-label"><input type="radio" value="spam" checked="checked" name="report[reason]">Contains clickbait, advertising, scams or script bots.</label><label class="form__wrapper-checkbox-label"><input type="radio" value="offensive" name="report[reason]">Contains racism, sexism, slurs, personal attacks, death threats, suicide requests or any form of hate speech.</label><label class="form__wrapper-checkbox-label"><input type="radio" value="does_not_belong" name="report[reason]">Contains illegal activity, suicide threats, personal information, or something else you think does not belong on Metadecidim.</label>
19
+ <label class="flag-modal__form-textarea-label">Additional comments<textarea rows="4" name="report[details]"></textarea></label>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <div data-dialog-actions="">
24
+ <button type="button" class="button button__lg button__transparent-secondary" data-dialog-close="flagModal">
25
+ Cancel
26
+ </button>
27
+ <button type="submit" class="button button__lg button__secondary">
28
+ <span>Report</span>
29
+ <%= icon("arrow-right-line") %>
30
+ </button>
31
+ </div>
32
+ </form>
33
+ </div>
34
+ </div>
@@ -0,0 +1,11 @@
1
+ <% content_for :heading do %>
2
+ Report
3
+ <% end %>
4
+
5
+ <% content_for :toc do %>
6
+ <% report_sections.each do |section| %>
7
+ <%= link_to(section_text(section), "##{section[:id]}") %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: report_sections } %>
@@ -0,0 +1,11 @@
1
+ <% content_for :heading do %>
2
+ Share
3
+ <% end %>
4
+
5
+ <% content_for :toc do %>
6
+ <% share_sections.each do |section| %>
7
+ <%= link_to(section_text(section), "##{section[:id]}") %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: share_sections } %>
@@ -0,0 +1,11 @@
1
+ <% content_for :heading do %>
2
+ Tab Panels
3
+ <% end %>
4
+
5
+ <% content_for :toc do %>
6
+ <% tab_panels_sections.each do |section| %>
7
+ <%= link_to(section_text(section), "##{section[:id]}") %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: tab_panels_sections } %>
@@ -0,0 +1,99 @@
1
+ <% content_for :heading do %>
2
+ Accessibility
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <p>Decidim follows the <u>Web Content Accessibility Guidelines (WCAG) 2.1</u>.</p>
7
+ <% end %>
8
+
9
+ <% content_for :toc do %>
10
+ <a href="#heading-order">Illogical heading order</a>
11
+ <a href="#unique-h1">Unique H1</a>
12
+ <a href="#one-heading">Heading on important sections</a>
13
+ <a href="#color-contrast">Color contrast</a>
14
+ <a href="#links-buttons">Links and buttons</a>
15
+ <a href="#a11y-labels">Accessibility labels</a>
16
+ <a href="#adjacent-links">Adjacent links</a>
17
+ <a href="#aria">Use ARIA</a>
18
+ <a href="#elements-hidden">Elements hidden</a>
19
+ <% end %>
20
+
21
+ <section id="heading-order" class="design__section">
22
+ <h2>Illogical heading order</h2>
23
+
24
+ <p>Every page should have a logical heading order when using the &#60;h1&#62;, &#60;h2&#62;, &#60;h3&#62;, &#60;h4&#62;, &#60;h5&#62; and &#60;h6&#62; heading elements.</p>
25
+
26
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_illogical_heading_order" target="_blank" rel="noopener noreferrer">here</a></p>
27
+ </section>
28
+
29
+ <section id="unique-h1" class="design__section">
30
+ <h2>Unique H1</h2>
31
+
32
+ <p>Every page should have a unique H1 heading on it</p>
33
+
34
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_unique_h1_on_every_page" target="_blank" rel="noopener noreferrer">here</a></p>
35
+ </section>
36
+
37
+ <section id="one-heading" class="design__section">
38
+ <h2>Heading on important sections</h2>
39
+
40
+ <p>It is highly important that each important section of the page has a heading to make it easier to understand what important sections are on the page just by browsing through its headings.</p>
41
+
42
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_heading_on_important_sections" target="_blank" rel="noopener noreferrer">here</a></p>
43
+ </section>
44
+
45
+ <section id="color-contrast" class="design__section">
46
+ <h2>Color contrast</h2>
47
+
48
+ <p>When creating user interfaces or modifying the colors, always make sure that you are not breaking accessibility with your changes. You can use the Color contrast checker to ensure that your colors have enough contrast against the background color where they are displayed at.</p>
49
+
50
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_color_contrast " target="_blank" rel="noopener noreferrer">here</a></p>
51
+ </section>
52
+
53
+ <section id="links-buttons" class="design__section">
54
+ <h2>Links and buttons</h2>
55
+
56
+ <p>The anchor elements (i.e. links) are meant to link to different pages or to anchor positions within the page. If the element is supposed to e.g. open some hidden item on that page, you should use the &#60;button&#62; element instead.</p>
57
+
58
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_links_and_buttons" target="_blank" rel="noopener noreferrer">here</a></p>
59
+ </section>
60
+
61
+ <section id="a11y-labels" class="design__section">
62
+ <h2>Accessibility labels</h2>
63
+
64
+ <p>When defining elements, always make sure they make sense for screen reader users.</p>
65
+
66
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_accessibility_labels" target="_blank" rel="noopener noreferrer">here</a></p>
67
+ </section>
68
+
69
+ <section id="adjacent-links" class="design__section">
70
+ <h2>Adjacent links for the same resource</h2>
71
+
72
+ <p>If the same resource has multiple adjacent links pointing to it, it makes it difficult for such users to glance through the page because they might need to go through multiple links to get to the next resource.</p>
73
+
74
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_adjacent_links_for_the_same_resource" target="_blank" rel="noopener noreferrer">here</a></p>
75
+ </section>
76
+
77
+ <section id="dynamic-changes" class="design__section">
78
+ <h2>Dynamic functionality changes the page context unintuitively</h2>
79
+
80
+ <p>Changes in the form inputs should not change the context of the page automatically.</p>
81
+
82
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_dynamic_functionality_changes_the_page_context_unintuitively" target="_blank" rel="noopener noreferrer">here</a></p>
83
+ </section>
84
+
85
+ <section id="aria" class="design__section">
86
+ <h2>Use ARIA attributes where possible</h2>
87
+
88
+ <p>Many elements that provide interactive functionality on the website require ARIA attributes on them to make them accessible.</p>
89
+
90
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_use_aria_attributes_where_possible" target="_blank" rel="noopener noreferrer">here</a></p>
91
+ </section>
92
+
93
+ <section id="elements-hidden" class="design__section">
94
+ <h2>Elements hidden from the accessibility API</h2>
95
+
96
+ <p>To hide an element from assistive technologies, use the aria-hidden="true" attribute on it.</p>
97
+
98
+ <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_elements_hidden_from_the_accessibility_api" target="_blank" rel="noopener noreferrer">here</a></p>
99
+ </section>
@@ -0,0 +1,26 @@
1
+ <table class="design__table">
2
+ <thead>
3
+ <th>Value</th>
4
+ <th>Tailwind name</th>
5
+ <% if columns.first[:rgba].present? %>
6
+ <th>Hex code</th>
7
+ <th>RGBA code</th>
8
+ <% end %>
9
+ <th>Usage</th>
10
+ </thead>
11
+ <tbody>
12
+ <% columns.each do |column| %>
13
+ <tr>
14
+ <td>
15
+ <div class="w-8 h-8 rounded shadow" style="background-color: <%= column[:value] %>;"></div>
16
+ </td>
17
+ <td><%= column[:name] %></td>
18
+ <% if column[:rgba].present? %>
19
+ <td><code><%= column[:value] %></code></td>
20
+ <td><code><%= column[:rgba] %></code></td>
21
+ <% end %>
22
+ <td><%= column[:usage] %></td>
23
+ </tr>
24
+ <% end %>
25
+ </tbody>
26
+ </table>
@@ -0,0 +1,16 @@
1
+ <% content_for :heading do %>
2
+ Color
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <p>We provide a Base palette with few colors so simple customizations are easy. You can modify the Base palette either in the Administration area or in the Tailwind configuration file if you need more advanced customization.</p>
7
+ <p>When customizing your colors, have in mind the <%= link_to "WCAG 2.1 AA compliant contrast ratios", "https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html" %>. You can check the contrast of your choosing with <%= link_to "WebAIM Contrast Checker", "https://webaim.org/resources/contrastchecker" %> or other similar tools.</p>
8
+ <% end %>
9
+
10
+ <% content_for :toc do %>
11
+ <% colors_sections.each do |section| %>
12
+ <%= link_to(section_text(section), "##{section[:id]}") %>
13
+ <% end %>
14
+ <% end %>
15
+
16
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: colors_sections } %>
@@ -0,0 +1,8 @@
1
+ <div class="mt-5 columns-3 space-y-4">
2
+ <% icons.each do |elem| %>
3
+ <div class="flex items-center gap-2 p-2.5 whitespace-nowrap">
4
+ <%= icon elem[:icon], class: "w-4 h-4 text-gray fill-current flex-none" %>
5
+ <span class="text-sm text-gray-2"><%= elem[:text] %></span>
6
+ </div>
7
+ <% end %>
8
+ </div>
@@ -0,0 +1,16 @@
1
+ <% content_for :heading do %>
2
+ Iconography
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <p>We use icons to reinforce the meaning of actions, titles, etc.</p>
7
+ <p>We use the Remixicon open source library: <a href="https://remixicon.com" target="_blank" rel="noopener noreferrer">https://remixicon.com</a></p>
8
+ <% end %>
9
+
10
+ <% content_for :toc do %>
11
+ <% iconography_sections.each do |section| %>
12
+ <%= link_to(section_text(section), "##{section[:id]}") %>
13
+ <% end %>
14
+ <% end %>
15
+
16
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: iconography_sections } %>
@@ -0,0 +1,128 @@
1
+ <% content_for :heading do %>
2
+ Layout
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <p>For desktop, Decidim uses a 12 column grid with limited number of templates (grid configurations) for different types of content. The objective is that a given type of content (homepage, list of elements, individual item) has a distinctive layout, so users can understand in which kind of content they are just by the general look of the page.</p>
7
+
8
+ <p>These simple rules should be followed when creating new modules or customizing existing ones, so a Decidim site can maintain its consistency.</p>
9
+
10
+ <ul class="list-disc pl-4">
11
+ <li>Homepage (of the site, of an space): full width</li>
12
+ <li>List of elements (of spaces, of items inside a space, etc): left aside</li>
13
+ <li>Individual item (proposal, blog post): centered, optionally with a right aside</li>
14
+ </ul>
15
+ <% end %>
16
+
17
+ <% content_for :toc do %>
18
+ <a href="#desktop">Desktop</a>
19
+ <a href="#tablet">Tablet</a>
20
+ <a href="#mobile">Mobile</a>
21
+ <a href="#code">Code</a>
22
+ <a href="#breakpoints">Breakpoints</a>
23
+ <% end %>
24
+
25
+ <section id="desktop" class="design__section">
26
+ <h2>Desktop <span class="label secondary">lg</span></h2>
27
+
28
+ <p>Desktop grid system is composed of 12 flexible columns with a gutter between columns of 16px and left and right margins of 48px</p>
29
+
30
+ <div class="grid grid-cols-12 gap-4">
31
+ <% 12.times do %>
32
+ <div class="bg-primary/10 text-center h-10"></div>
33
+ <% end %>
34
+ </div>
35
+ </section>
36
+
37
+ <section id="tablet" class="design__section">
38
+ <h2>Tablet <span class="label secondary">md</span></h2>
39
+
40
+ <p>Tablet grid system is composed of 8 flexible columns with a gutter between columns of 16px and left and right margins of 24px</p>
41
+
42
+ <div class="grid grid-cols-6 gap-4">
43
+ <% 6.times do %>
44
+ <div class="bg-primary/10 text-center h-10"></div>
45
+ <% end %>
46
+ </div>
47
+ </section>
48
+
49
+ <section id="mobile" class="design__section">
50
+ <h2>Mobile <span class="label secondary">sm</span></h2>
51
+
52
+ <p>Mobile grid system is composed of 4 flexible columns with a gutter between columns of 16px and left and right margins of 16px. For sizes below 320px this margins are set to 8px</p>
53
+
54
+ <div class="grid grid-cols-4 gap-4">
55
+ <% 4.times do %>
56
+ <div class="bg-primary/10 text-center h-10"></div>
57
+ <% end %>
58
+ </div>
59
+ </section>
60
+
61
+ <section id="code" class="design__section">
62
+ <h2>Code</h2>
63
+
64
+ <p>When implementing new modules you have some helpers that automatically provides you with the code needed to setup the HTML structure. You should use these helpers instead of directly using div elements with classes, so you maintain consistency.</p>
65
+
66
+ <p>You can find the basic layouts in <a href="https://github.com/decidim/decidim/tree/develop/decidim-core/app/views/layouts/decidim/shared" target="_blank" rel="noopener noreferrer" class="text-secondary underline">https://github.com/decidim/decidim/tree/develop/decidim-core/app/views/layouts/decidim/shared</a></p>
67
+
68
+ <h3 class="text-xl">Full width</h3>
69
+
70
+ <p>No required</p>
71
+
72
+ <h3 class="text-xl">Left aside</h3>
73
+
74
+ <code class="p-4 rounded block bg-background">
75
+ &lt;%= render layout: "layouts/decidim/shared/layout_two_col" do %&gt;
76
+ ...
77
+ &lt;% end %&gt;
78
+ </code>
79
+
80
+ <h3 class="text-xl">Right aside</h3>
81
+
82
+ <code class="p-4 rounded block bg-background">
83
+ &lt;%= render layout: "layouts/decidim/shared/layout_two_col", locals: { reverse: true } do %&gt;
84
+ ...
85
+ &lt;% end %&gt;
86
+ </code>
87
+
88
+ <h3 class="text-xl">Centered</h3>
89
+
90
+ <code class="p-4 rounded block bg-background">
91
+ &lt;%= render layout: "layouts/decidim/shared/layout_center", locals: { columns: 10 } do %&gt;
92
+ ...
93
+ &lt;% end %&gt;
94
+ </code>
95
+
96
+ <p>Being the number of columns 10, 8 or 6.</p>
97
+
98
+ </section>
99
+
100
+ <section id="breakpoints" class="design__section">
101
+ <h2>Breakpoints</h2>
102
+
103
+ <p>To manage the responsive max-width of elements we rely on the default `container` Tailwind class, which states the following breakpoints:</p>
104
+
105
+ <table class="design__table">
106
+ <thead>
107
+ <th>Breakpoint</th>
108
+ <th>Properties</th>
109
+ </thead>
110
+ <tbody>
111
+ <%
112
+ rows = []
113
+ rows << { breakpoint: "sm (640px)", properties: "max-width: 640px;" }
114
+ rows << { breakpoint: "md (768px)", properties: "max-width: 768px;" }
115
+ rows << { breakpoint: "lg (1024px)", properties: "max-width: 1024px;" }
116
+ rows << { breakpoint: "xl (1280px)", properties: "max-width: 1280px;" }
117
+ rows << { breakpoint: "2xl (1536px)", properties: "max-width: 1536px;" }
118
+
119
+ rows.each do |row|
120
+ %>
121
+ <tr>
122
+ <td><%= row[:breakpoint] %></td>
123
+ <td><%= row[:properties] %></td>
124
+ </tr>
125
+ <% end %>
126
+ </tbody>
127
+ </table>
128
+ </section>
@@ -0,0 +1,15 @@
1
+ <% content_for :heading do %>
2
+ Typography
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <p>These guidelines summarize how use typography at Decidim, and serve as guardrails for designers to design freely with best typographic practices in mind</p>
7
+ <% end %>
8
+
9
+ <% content_for :toc do %>
10
+ <% typography_sections.each do |section| %>
11
+ <%= link_to(section_text(section), "##{section[:id]}") %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ <%= render partial: "decidim/design/shared/sections", locals: { sections: typography_sections } %>
@@ -0,0 +1,17 @@
1
+ <% content_for :right_aside do %>
2
+ <%= link_to "https://github.com/decidim/decidim", target: "_blank", data: { "external-link": false }, class: "flex items-center justify-end gap-1 font-semibold text-secondary" do %>
3
+ <span class="whitespace-nowrap">Source code on GitHub</span>
4
+ <%= icon "github-fill", class: "flex-none w-3.5 h-3.5 fill-current" %>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <section>
9
+ <h1 class="text-[72px] leading-[90px] font-bold text-transparent bg-clip-text bg-[linear-gradient(96deg,_var(--primary)_22.02%,_var(--secondary)_44.83%)] after:content-[''] after:block after:w-20 after:h-2 after:mt-1.5 after:bg-primary after:rounded-b-xl">Decidim Design Guide</h1>
10
+
11
+ <div class="text-lg space-y-4 mt-12">
12
+ <h2 class="font-semibold">The guide to design all things Decidim</h2>
13
+ <p>Welcome to the Decidim Design Guide (DDG). This guide is the resource for designers and developers who need to customize, develop new modules, and integrate new features.</p>
14
+ <p>By sharing the principles, philosophy, and rationale behind design decisions we want to empower the community to contribute with consistency so we reach the best participant experience.</p>
15
+ <p>At the same time, we document the different UI components and patterns in use, that should be reused or extended.</p>
16
+ </div>
17
+ </section>
@@ -0,0 +1,3 @@
1
+ <div class="card__grid-grid">
2
+ <%= yield %>
3
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="design__section-snippet">
2
+ <p>Source code on GitHub: <%= link_to(text, url, target: "_blank", rel: "noopener noreferrer") %></p>
3
+ <code>
4
+ <textarea rows="5"><%= Nokogiri::XML(cell(cell, *args).call, &:noblanks).root %></textarea>
5
+ </code>
6
+ </div>