swop 0.1.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 (49) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/LICENSE +201 -0
  5. data/README.md +15 -0
  6. data/Rakefile +4 -0
  7. data/app/assets/javascripts/rails_admin/application.js.erb +32 -0
  8. data/app/assets/javascripts/rails_admin/custom/filtering-select.js +304 -0
  9. data/app/assets/javascripts/rails_admin/custom/sidescroll.js +20 -0
  10. data/app/assets/javascripts/rails_admin/custom/ui.js +11 -0
  11. data/app/assets/stylesheets/rails_admin/application.scss.erb +52 -0
  12. data/app/assets/stylesheets/rails_admin/custom/base/base.scss +5 -0
  13. data/app/assets/stylesheets/rails_admin/custom/base/bootstrap-variables.scss +196 -0
  14. data/app/assets/stylesheets/rails_admin/custom/base/mixins.scss +88 -0
  15. data/app/assets/stylesheets/rails_admin/custom/base/typography.scss +16 -0
  16. data/app/assets/stylesheets/rails_admin/custom/base/variables.scss +86 -0
  17. data/app/assets/stylesheets/rails_admin/custom/components/breadcrumbs.scss +18 -0
  18. data/app/assets/stylesheets/rails_admin/custom/components/buttons.scss +55 -0
  19. data/app/assets/stylesheets/rails_admin/custom/components/dropdowns.scss +40 -0
  20. data/app/assets/stylesheets/rails_admin/custom/components/filtering-select.scss +43 -0
  21. data/app/assets/stylesheets/rails_admin/custom/components/forms.scss +25 -0
  22. data/app/assets/stylesheets/rails_admin/custom/components/images.scss +21 -0
  23. data/app/assets/stylesheets/rails_admin/custom/components/navbar.scss +18 -0
  24. data/app/assets/stylesheets/rails_admin/custom/components/navs.scss +28 -0
  25. data/app/assets/stylesheets/rails_admin/custom/components/offcanvas.scss +18 -0
  26. data/app/assets/stylesheets/rails_admin/custom/components/progress.scss +11 -0
  27. data/app/assets/stylesheets/rails_admin/custom/components/sidebar.scss +115 -0
  28. data/app/assets/stylesheets/rails_admin/custom/components/table.scss +59 -0
  29. data/app/assets/stylesheets/rails_admin/custom/components/tiles.scss +20 -0
  30. data/app/assets/stylesheets/rails_admin/custom/layouts/body.scss +10 -0
  31. data/app/assets/stylesheets/rails_admin/custom/layouts/containers.scss +31 -0
  32. data/app/helpers/rails_admin/application_helper.rb +270 -0
  33. data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +1 -0
  34. data/app/views/layouts/rails_admin/application.html.erb +24 -0
  35. data/app/views/layouts/rails_admin/content.html.erb +57 -0
  36. data/app/views/layouts/rails_admin/custom/_nav.html.erb +10 -0
  37. data/app/views/rails_admin/main/_submit_buttons.html.erb +25 -0
  38. data/app/views/rails_admin/main/dashboard.html.erb +70 -0
  39. data/app/views/rails_admin/main/delete.html.erb +19 -0
  40. data/app/views/rails_admin/main/edit.html.erb +5 -0
  41. data/app/views/rails_admin/main/export.html.erb +128 -0
  42. data/app/views/rails_admin/main/index.html.erb +170 -0
  43. data/app/views/rails_admin/main/new.html.erb +5 -0
  44. data/app/views/rails_admin/main/show.html.erb +28 -0
  45. data/lib/swop/engine.rb +7 -0
  46. data/lib/swop/version.rb +5 -0
  47. data/lib/swop.rb +8 -0
  48. data/sig/swop.rbs +4 -0
  49. metadata +140 -0
@@ -0,0 +1,304 @@
1
+ import jQuery from "jquery";
2
+ import "jquery-ui/ui/widget.js";
3
+ import "jquery-ui/ui/widgets/autocomplete.js";
4
+ import I18n from "./i18n";
5
+
6
+ (function ($) {
7
+ "use strict";
8
+
9
+ $.widget("ra.filteringSelect", $.ra.abstractSelect, {
10
+ options: {
11
+ minLength: 0,
12
+ searchDelay: 200,
13
+ remote_source: null,
14
+ source: null,
15
+ xhr: false,
16
+ },
17
+
18
+ button: null,
19
+ input: null,
20
+ select: null,
21
+ filtering_select: null,
22
+
23
+ _create: function () {
24
+ this.filtering_select = this.element.siblings(
25
+ '[data-input-for="' + this.element.attr("id") + '"]'
26
+ );
27
+
28
+ // When using the browser back and forward buttons, it is possible that
29
+ // the autocomplete field will be cached which causes duplicate fields
30
+ // to be generated.
31
+ if (this.filtering_select.length > 0) {
32
+ this.input = this.filtering_select.children("input");
33
+ this.button = this.filtering_select.children(".input-group-btn");
34
+ } else {
35
+ this.element.hide();
36
+ this.filtering_select = this._inputGroup(this.element.attr("id"));
37
+ this.input = this._inputField();
38
+ this.button = this._buttonField();
39
+ }
40
+ this.clearOption = $('<span></span>').append(
41
+ '<i class="fas fa-times me-2"></i> ' +
42
+ $('<span></span>').text(I18n.t("clear")).html()
43
+ );
44
+ this.noObjectsPlaceholder = $('<option disabled="disabled" />').text(
45
+ I18n.t("no_objects")
46
+ );
47
+
48
+ this._setOptionsSource();
49
+ this._initAutocomplete();
50
+ this._initKeyEvent();
51
+ this._overloadRenderItem();
52
+ this._autocompleteDropdownEvent(this.button);
53
+
54
+ return this.filtering_select
55
+ .append(this.input)
56
+ .append(this.button)
57
+ .insertAfter(this.element);
58
+ },
59
+
60
+ _getResultSet: function (request, data, xhr) {
61
+ var matcher = new RegExp(
62
+ $.ui.autocomplete.escapeRegex(request.term),
63
+ "i"
64
+ );
65
+
66
+ var spannedContent = function (content) {
67
+ return $("<span>").text(content).html();
68
+ };
69
+
70
+ var highlighter = function (label, word) {
71
+ if (word.length) {
72
+ return $.map(label.split(word), function (el) {
73
+ return spannedContent(el);
74
+ }).join($("<strong>").text(word)[0].outerHTML);
75
+ } else {
76
+ return spannedContent(label);
77
+ }
78
+ };
79
+
80
+ var matches = $.map(data, function (el) {
81
+ var id = el.id || el.value;
82
+ var value = el.label || el.id;
83
+ // match regexp only for local requests, remote ones are already
84
+ // filtered, and label may not contain filtered term.
85
+ if (id && (xhr || matcher.test(el.label))) {
86
+ return {
87
+ html: highlighter(value, request.term),
88
+ value: value,
89
+ id: id,
90
+ };
91
+ }
92
+ });
93
+
94
+ if (request.term.length === 0 && !this.input.attr("required")) {
95
+ return [{ html: this.clearOption, value: null, id: null }].concat(
96
+ matches
97
+ );
98
+ } else if (matches.length === 0) {
99
+ return [{ html: this.noObjectsPlaceholder, value: null, id: null }];
100
+ } else {
101
+ return matches;
102
+ }
103
+ },
104
+
105
+ _getSourceFunction: function (source) {
106
+ var self = this;
107
+ var requestIndex = 0;
108
+
109
+ if ($.isArray(source)) {
110
+ return function (request, response) {
111
+ response(self._getResultSet(request, source, false));
112
+ };
113
+ } else if (typeof source === "string") {
114
+ return function (request, response) {
115
+ if (this.xhr) {
116
+ this.xhr.abort();
117
+ }
118
+
119
+ this.xhr = $.ajax({
120
+ url: source,
121
+ data: self.options.createQuery(request.term),
122
+ dataType: "json",
123
+ autocompleteRequest: ++requestIndex,
124
+ success: function (data, status) {
125
+ if (this.autocompleteRequest === requestIndex) {
126
+ response(self._getResultSet(request, data, true));
127
+ }
128
+ },
129
+ error: function () {
130
+ if (this.autocompleteRequest === requestIndex) {
131
+ response([]);
132
+ }
133
+ },
134
+ });
135
+ };
136
+ } else {
137
+ return source;
138
+ }
139
+ },
140
+
141
+ _setOptionsSource: function () {
142
+ if (this.options.xhr) {
143
+ this.options.source = this.options.remote_source;
144
+ } else {
145
+ this.options.source = this.element
146
+ .children("option")
147
+ .map(function () {
148
+ return { label: $(this).text(), value: this.value };
149
+ })
150
+ .toArray();
151
+ }
152
+ },
153
+
154
+ _buttonField: function () {
155
+ return $(
156
+ '<div class="input-group-btn btn btn-white dropdown-toggle">' +
157
+ "</div>"
158
+ );
159
+ },
160
+
161
+ _autocompleteDropdownEvent: function (element) {
162
+ var self = this;
163
+
164
+ return element.click(function () {
165
+ // close if already visible
166
+ if (self.input.autocomplete("widget").is(":visible")) {
167
+ self.input.autocomplete("close");
168
+ return;
169
+ }
170
+
171
+ // pass empty string as value to search for, displaying all results
172
+ self.input.autocomplete("search", "");
173
+ self.input.focus();
174
+ });
175
+ },
176
+
177
+ _inputField: function () {
178
+ var input;
179
+ var selected = this.element.children(":selected");
180
+ var value = selected.val() ? selected.text() : "";
181
+
182
+ input = $('<input type="text">')
183
+ .val(value)
184
+ .addClass("form-control ra-filtering-select-input")
185
+ .attr("style", this.element.attr("style"))
186
+ .show();
187
+
188
+ if (this.element.attr("placeholder")) {
189
+ input.attr("placeholder", this.element.attr("placeholder"));
190
+ }
191
+
192
+ if (this.element.attr("required")) {
193
+ input.attr("required", this.element.attr("required"));
194
+ this.element.attr("required", false);
195
+ }
196
+
197
+ return input;
198
+ },
199
+
200
+ _inputGroup: function (inputFor) {
201
+ return $("<div>")
202
+ .addClass("input-group filtering-select")
203
+ .attr("data-input-for", inputFor);
204
+ },
205
+
206
+ _initAutocomplete: function () {
207
+ var self = this;
208
+
209
+ return this.input.autocomplete({
210
+ delay: this.options.searchDelay,
211
+ minLength: this.options.minLength,
212
+ source: this._getSourceFunction(this.options.source),
213
+ select: function (event, ui) {
214
+ var option = self.element.find(
215
+ `option[value="${CSS.escape(ui.item.id)}"]`
216
+ );
217
+ self.element.find("option[selected]").attr("selected", false);
218
+ if (option.length > 0) {
219
+ option.attr("selected", "selected");
220
+ } else {
221
+ option = $("<option>")
222
+ .attr("value", ui.item.id)
223
+ .attr("selected", true)
224
+ .text(ui.item.value);
225
+ self.element.append(option);
226
+ }
227
+ self.element.trigger("change", ui.item.id);
228
+ self._trigger("selected", event, {
229
+ item: option,
230
+ });
231
+ $(self.element.parents(".controls")[0])
232
+ .find(".update")
233
+ .removeClass("disabled");
234
+ },
235
+ change: function (event, ui) {
236
+ if (ui.item) {
237
+ return;
238
+ }
239
+
240
+ var matcher = new RegExp(
241
+ "^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$",
242
+ "i"
243
+ );
244
+ var valid = false;
245
+
246
+ self.element.children("option").each(function () {
247
+ if ($(this).text().match(matcher)) {
248
+ valid = true;
249
+ return false;
250
+ }
251
+ });
252
+
253
+ if (valid || $(this).val() !== "") {
254
+ return;
255
+ }
256
+
257
+ // remove invalid value, as it didn't match anything
258
+ $(this).val(null);
259
+ self.element.html(
260
+ $('<option value="" selected="selected"></option>')
261
+ );
262
+ self.input.data("ui-autocomplete").term = "";
263
+ $(self.element.parents(".controls")[0])
264
+ .find(".update")
265
+ .addClass("disabled");
266
+ return false;
267
+ },
268
+ });
269
+ },
270
+
271
+ _initKeyEvent: function () {
272
+ var self = this;
273
+
274
+ return this.input.keyup(function () {
275
+ if ($(this).val().length) {
276
+ return;
277
+ }
278
+
279
+ /* Clear select options and trigger change if selected item is deleted */
280
+ return self.element
281
+ .html($('<option value="" selected="selected"></option>'))
282
+ .trigger("change");
283
+ });
284
+ },
285
+
286
+ _overloadRenderItem: function () {
287
+ this.input.data("ui-autocomplete")._renderItem = function (ul, item) {
288
+ return $("<li></li>")
289
+ .data("ui-autocomplete-item", item)
290
+ .append($("<a></a>").html(item.html || item.id))
291
+ .appendTo(ul);
292
+ };
293
+ },
294
+
295
+ destroy: function () {
296
+ this.input.remove();
297
+ this.button.remove();
298
+ this.element.html($('<option value="" selected="selected"></option>'));
299
+ this.element.show();
300
+ this.filtering_select.remove();
301
+ $.Widget.prototype.destroy.call(this);
302
+ },
303
+ });
304
+ })(jQuery);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ {
4
+ document.addEventListener("rails_admin.dom_ready", () => {
5
+ const scroller = document.getElementById("sidescroll");
6
+ if (!scroller) {
7
+ return;
8
+ }
9
+
10
+ scroller.querySelectorAll("tr").forEach((tr, index) => {
11
+ let firstPosition;
12
+ tr.querySelectorAll("th.sticky, td.sticky").forEach((td, idx) => {
13
+ if (idx === 0) {
14
+ firstPosition = td.offsetLeft;
15
+ }
16
+ td.style.left = `${td.offsetLeft + -12 - firstPosition}px`;
17
+ });
18
+ });
19
+ });
20
+ }
@@ -0,0 +1,11 @@
1
+ import jQuery from "jquery";
2
+ import "jquery-ui/ui/effect.js";
3
+
4
+ (function ($) {
5
+
6
+ $(document).on("change", "#reverse-selection", function () {
7
+ const isChecked = $(this).is(":checked"); // true if checked, false if unchecked
8
+ $(this).closest(".checkbox").next(".control-group").find(".controls input:checkbox").prop("checked", isChecked);
9
+ });
10
+
11
+ })(jQuery);
@@ -0,0 +1,52 @@
1
+ @charset "UTF-8";
2
+
3
+ // Mixins
4
+ @import "rails_admin/styles/base/mixins";
5
+ @import "rails_admin/custom/base/base";
6
+ @import "rails_admin/custom/base/mixins";
7
+
8
+ // Variables
9
+ @import "rails_admin/custom/base/variables";
10
+ @import "rails_admin/custom/base/bootstrap-variables";
11
+ @import "rails_admin/styles/base/variables";
12
+
13
+ // Bootstrap
14
+ @import "rails_admin/bootstrap/bootstrap";
15
+
16
+ // Libraries
17
+ @import "rails_admin/flatpickr";
18
+ @import "rails_admin/styles/filtering-select";
19
+ @import "rails_admin/styles/filtering-multiselect";
20
+ @import "rails_admin/styles/widgets";
21
+
22
+ // Font Awesome
23
+ @import "rails_admin/font-awesome";
24
+
25
+ // RailsAdmin Theming
26
+ @import "rails_admin/styles/base/theming";
27
+
28
+ // Base
29
+ @import "rails_admin/custom/base/typography";
30
+
31
+ // Layouts
32
+ @import "rails_admin/custom/layouts/body";
33
+ @import "rails_admin/custom/layouts/containers";
34
+
35
+ // Components
36
+ @import "rails_admin/custom/components/breadcrumbs";
37
+ @import "rails_admin/custom/components/buttons";
38
+ @import "rails_admin/custom/components/dropdowns";
39
+ @import "rails_admin/custom/components/filtering-select";
40
+ @import "rails_admin/custom/components/forms";
41
+ @import "rails_admin/custom/components/images";
42
+ @import "rails_admin/custom/components/navbar";
43
+ @import "rails_admin/custom/components/navs";
44
+ @import "rails_admin/custom/components/offcanvas";
45
+ @import "rails_admin/custom/components/progress";
46
+ @import "rails_admin/custom/components/sidebar";
47
+ @import "rails_admin/custom/components/table";
48
+ @import "rails_admin/custom/components/tiles";
49
+
50
+ <% if defined?(ActionText::Engine) && Rails.gem_version >= Gem::Version.new('7.0') %>
51
+ @import "trix";
52
+ <% end %>
@@ -0,0 +1,5 @@
1
+ // Font anti-aliasing fix for Mac users
2
+ * {
3
+ -moz-osx-font-smoothing: grayscale;
4
+ -webkit-font-smoothing: antialiased;
5
+ }
@@ -0,0 +1,196 @@
1
+ // Color system
2
+ $white: $white;
3
+ $black: $black;
4
+
5
+ $primary: $primary-color;
6
+ $secondary: $secondary-color;
7
+ $success: $success-color;
8
+ $info: $info-color;
9
+ $warning: $warning-color;
10
+ $danger: $danger-color;
11
+ $light: $light-color;
12
+ $dark: $dark-color;
13
+
14
+ // Spacing
15
+ $spacer: $spacer;
16
+ $spacers: (
17
+ 0: 0,
18
+ 1: $spacer-1,
19
+ 2: $spacer-2,
20
+ 3: $spacer-3,
21
+ 4: $spacer-4,
22
+ 5: $spacer-5,
23
+ 6: $spacer-6,
24
+ 7: $spacer-7,
25
+ 8: $spacer-8,
26
+ 9: $spacer-9,
27
+ 10: $spacer-10,
28
+ 11: $spacer-11
29
+ );
30
+
31
+ // Body
32
+ $body-color: $text-color;
33
+ $body-bg: $light-color;
34
+
35
+ $body-secondary-color: $text-secondary-color;
36
+ $text-muted: $text-secondary-color;
37
+
38
+ // Links
39
+ $link-decoration: none;
40
+
41
+ // Paragraphs
42
+ $paragraph-margin-bottom: $spacer-3;
43
+
44
+ // Grid columns
45
+ $grid-columns: 24;
46
+ $grid-gutter-width: $spacer-6;
47
+
48
+ // Components
49
+ $border-width: $border-width;
50
+ $border-color: $border-color;
51
+
52
+ $border-radius: $md-border-radius;
53
+ $border-radius-sm: $sm-border-radius;
54
+ $border-radius-lg: $lg-border-radius;
55
+
56
+ $box-shadow: $md-box-shadow;
57
+ $box-shadow-lg: $lg-box-shadow;
58
+
59
+ $transition-base: $md-transition;
60
+
61
+ // Typography
62
+ $font-family-sans-serif: $body-family;
63
+
64
+ $font-size-base: $base-font-size;
65
+ $font-size-sm: $sm-font-size;
66
+ $font-size-lg: $lg-font-size;
67
+
68
+ $font-weight-normal: $fw-normal;
69
+ $font-weight-medium: $fw-medium;
70
+ $font-weight-semibold: $fw-semibold;
71
+ $font-weight-bold: $fw-bold;
72
+
73
+ $font-weight-base: $fw-medium;
74
+
75
+ $line-height-base: 1.625;
76
+
77
+ $h1-font-size: $h1-font-size;
78
+ $h2-font-size: $h2-font-size;
79
+ $h3-font-size: $h3-font-size;
80
+ $h4-font-size: $h4-font-size;
81
+ $h5-font-size: $h5-font-size;
82
+ $h6-font-size: $h6-font-size;
83
+
84
+ $headings-margin-bottom: $spacer-2;
85
+ $headings-font-family: $headings-family;
86
+ $headings-font-weight: $fw-extrabold;
87
+ $headings-color: $dark-color;
88
+
89
+ $lead-font-size: $lg-font-size;
90
+ $lead-font-weight: $fw-medium;
91
+
92
+ $hr-margin-y: 0;
93
+ $hr-color: $border-color;
94
+
95
+ $hr-border-color: $border-color;
96
+ $hr-border-width: $border-width;
97
+ $hr-opacity: 1;
98
+
99
+ // Buttons + Forms
100
+ $input-btn-padding-y: $spacer * 1.75; // 7px
101
+ $input-btn-padding-x: $spacer * 3.5; // 14px
102
+
103
+ $input-btn-padding-y-sm: $spacer * 1.5; // 6px
104
+ $input-btn-padding-x-sm: $spacer * 3; // 12px
105
+
106
+ $input-btn-padding-y-lg: $spacer * 2; // 8px
107
+ $input-btn-padding-x-lg: $spacer * 4; // 16px
108
+
109
+ // Buttons
110
+ $btn-padding-x: $spacer * 4; // 16px
111
+
112
+ $btn-padding-x-sm: $spacer * 3.5; // 14px
113
+
114
+ $btn-padding-x-lg: $spacer * 5; // 20px
115
+
116
+ $btn-font-weight: $fw-bold;
117
+
118
+ $btn-border-radius: $spacer * 2.5; // 10px
119
+ $btn-border-radius-sm: $spacer * 2; // 8px
120
+ $btn-border-radius-lg: $spacer * 3; // 12px
121
+
122
+ // Forms
123
+ $form-text-margin-top: $spacer-1;
124
+ $form-text-font-size: $sm-font-size;
125
+ $form-text-color: $text-secondary-color;
126
+
127
+ $form-label-margin-bottom: $spacer-1;
128
+ $form-label-font-size: $sm-font-size;
129
+ $form-label-font-weight: $fw-semibold;
130
+ $form-label-color: $dark-color;
131
+
132
+ $input-bg: $white;
133
+ $input-disabled-color: $text-secondary-color;
134
+ $input-disabled-bg: $light-color;
135
+ $input-disabled-border-color: $light-color;
136
+
137
+ $input-border-color: $border-color;
138
+
139
+ $form-check-padding-start: $spacer-7;
140
+ $form-check-margin-bottom: 0;
141
+ $form-check-label-color: $form-label-color;
142
+
143
+ $form-check-input-border: $border-width solid $border-color;
144
+
145
+ $form-switch-color: $border-color;
146
+ $form-switch-padding-start: 0;
147
+
148
+ // Navbar
149
+ $navbar-toggler-padding-y: $spacer-1;
150
+ $navbar-toggler-padding-x: $spacer-1;
151
+ $navbar-toggler-font-size: 0;
152
+
153
+ // Dropdowns
154
+ $dropdown-min-width: rem(175px);
155
+ $dropdown-padding-x: 0;
156
+ $dropdown-padding-y: $spacer-2;
157
+ $dropdown-spacer: $spacer-2;
158
+ $dropdown-font-size: $sm-font-size;
159
+ $dropdown-border-width: 0;
160
+ $dropdown-divider-margin-y: $spacer-4;
161
+
162
+ $dropdown-link-hover-color: $dark-color;
163
+ $dropdown-link-hover-bg: rgba($dark-color, 0.05);
164
+
165
+ $dropdown-link-active-color: $dark-color;
166
+ $dropdown-link-active-bg: rgba($dark-color, 0.05);
167
+
168
+ $dropdown-link-disabled-color: $text-secondary-color;
169
+
170
+ $dropdown-item-padding-y: $spacer * 1.75; // 7px
171
+ $dropdown-item-padding-x: $spacer-4;
172
+
173
+ $dropdown-header-color: $text-secondary-color;
174
+ $dropdown-header-padding-x: $dropdown-item-padding-x;
175
+ $dropdown-header-padding-y: $dropdown-padding-y;
176
+ $dropdown-header-padding: $dropdown-header-padding-y $dropdown-header-padding-x;
177
+
178
+ // Progress bars
179
+ $progress-height: rem(16px);
180
+ $progress-font-size: $xs-font-size;
181
+ $progress-bg: $border-color;
182
+ $progress-border-radius: $lg-border-radius;
183
+
184
+ // Badges
185
+ $badge-font-size: $xs-font-size;
186
+ $badge-padding-y: $spacer-1;
187
+ $badge-padding-x: $spacer-2;
188
+ $badge-border-radius: $sm-border-radius;
189
+
190
+ // Offcanvas
191
+ $offcanvas-padding-y: $spacer-4;
192
+ $offcanvas-padding-x: $spacer-3;
193
+ $offcanvas-horizontal-width: rem(299px);
194
+ $offcanvas-border-width: 0;
195
+ $offcanvas-bg-color: transparent;
196
+ $offcanvas-box-shadow: none;
@@ -0,0 +1,88 @@
1
+ $rem-baseline: 16px !default;
2
+ $rem-fallback: false !default;
3
+ $rem-px-only: false !default;
4
+
5
+ @function rem-separator($list, $separator: false) {
6
+ @if $separator == "comma" or $separator == "space" {
7
+ @return append($list, null, $separator);
8
+ }
9
+
10
+ @if function-exists("list-separator") == true {
11
+ @return list-separator($list);
12
+ }
13
+
14
+ // list-separator polyfill by Hugo Giraudel (https://sass-compatibility.github.io/#list_separator_function)
15
+ $test-list: ();
16
+ @each $item in $list {
17
+ $test-list: append($test-list, $item, space);
18
+ }
19
+
20
+ @return if($test-list == $list, space, comma);
21
+ }
22
+
23
+ @mixin rem-baseline($zoom: 100%) {
24
+ font-size: ($zoom / 16px) * $rem-baseline;
25
+ }
26
+
27
+ @function rem-convert($to, $values...) {
28
+ $result: ();
29
+ $separator: rem-separator($values);
30
+
31
+ @each $value in $values {
32
+ @if type-of($value) == "number" and unit($value) == "rem" and $to == "px" {
33
+ $result: append($result, ($value / 1rem) * $rem-baseline, $separator);
34
+ } @else if type-of($value) == "number" and unit($value) == "px" and $to == "rem" {
35
+ $result: append($result, ($value / $rem-baseline) * 1rem, $separator);
36
+ } @else if type-of($value) == "list" {
37
+ $value-separator: rem-separator($value);
38
+ $value: rem-convert($to, $value...);
39
+ $value: rem-separator($value, $value-separator);
40
+ $result: append($result, $value, $separator);
41
+ } @else {
42
+ $result: append($result, $value, $separator);
43
+ }
44
+ }
45
+
46
+ @return if(length($result) == 1, nth($result, 1), $result);
47
+ }
48
+
49
+ @function rem($values...) {
50
+ @if $rem-px-only {
51
+ @return rem-convert(px, $values...);
52
+ } @else {
53
+ @return rem-convert(rem, $values...);
54
+ }
55
+ }
56
+
57
+ @mixin rem($properties, $values...) {
58
+ @if type-of($properties) == "map" {
59
+ @each $property in map-keys($properties) {
60
+ @include rem($property, map-get($properties, $property));
61
+ }
62
+ } @else {
63
+ @each $property in $properties {
64
+ @if $rem-fallback or $rem-px-only {
65
+ #{$property}: rem-convert(px, $values...);
66
+ }
67
+ @if not $rem-px-only {
68
+ #{$property}: rem-convert(rem, $values...);
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ //does not work with colors containing alpha
75
+ @function encode-color($string) {
76
+ @if type-of($string) == 'color' {
77
+ $hex: str-slice(ie-hex-str($string), 4);
78
+ $string:unquote("#{$hex}");
79
+ }
80
+ $string: '%23' + $string;
81
+ @return $string;
82
+ }
83
+
84
+ @mixin text-gradient() {
85
+ -webkit-background-clip: text;
86
+ background-clip: text;
87
+ -webkit-text-fill-color: transparent;
88
+ }
@@ -0,0 +1,16 @@
1
+ h1, .h1,
2
+ h2, .h2,
3
+ h3, .h3,
4
+ h4, .h4,
5
+ h5, .h5,
6
+ h6, .h6 {
7
+ letter-spacing: -0.02em;
8
+ }
9
+
10
+ .fw-semibold {
11
+ font-weight: $fw-semibold !important;
12
+ }
13
+
14
+ .fw-extrabold {
15
+ font-weight: $fw-extrabold !important;
16
+ }