chulapa-jekyll 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +27 -0
  3. data/LICENSE +21 -0
  4. data/README.md +126 -0
  5. data/_includes/components/author.html +40 -0
  6. data/_includes/components/breadcrumbdatesocial.html +63 -0
  7. data/_includes/components/categories.html +15 -0
  8. data/_includes/components/disqus.html +24 -0
  9. data/_includes/components/headers.html +124 -0
  10. data/_includes/components/indexcards.html +48 -0
  11. data/_includes/components/navbeforeafter.html +22 -0
  12. data/_includes/components/tags.html +15 -0
  13. data/_includes/components/toc.html +112 -0
  14. data/_includes/custom/custom_bottomscripts.html +5 -0
  15. data/_includes/custom/custom_head.html +8 -0
  16. data/_includes/custom/custom_head_before_css.html +5 -0
  17. data/_includes/custom/giscus.html +1 -0
  18. data/_includes/footer.html +129 -0
  19. data/_includes/head.html +309 -0
  20. data/_includes/navbar.html +205 -0
  21. data/_includes/search/algolia.html +3 -0
  22. data/_includes/search/google.html +11 -0
  23. data/_includes/search/lunr.html +7 -0
  24. data/_includes/snippets/bootstrapdemo.html +1390 -0
  25. data/_includes/snippets/carousel.html +61 -0
  26. data/_includes/snippets/datetranslate.html +48 -0
  27. data/_includes/snippets/masonry.html +23 -0
  28. data/_includes/snippets/video.html +26 -0
  29. data/_includes/snippets/youtube.html +6 -0
  30. data/_layouts/archive.html +82 -0
  31. data/_layouts/cloudcategory.html +89 -0
  32. data/_layouts/cloudtag.html +86 -0
  33. data/_layouts/compress.html +10 -0
  34. data/_layouts/default.html +39 -0
  35. data/_layouts/indexcategory.html +36 -0
  36. data/_layouts/landingpage.html +51 -0
  37. data/_layouts/minimal.html +21 -0
  38. data/_layouts/search.html +59 -0
  39. data/_sass/bootstrap/_alert.scss +51 -0
  40. data/_sass/bootstrap/_badge.scss +54 -0
  41. data/_sass/bootstrap/_breadcrumb.scss +44 -0
  42. data/_sass/bootstrap/_button-group.scss +163 -0
  43. data/_sass/bootstrap/_buttons.scss +142 -0
  44. data/_sass/bootstrap/_card.scss +282 -0
  45. data/_sass/bootstrap/_carousel.scss +197 -0
  46. data/_sass/bootstrap/_close.scss +40 -0
  47. data/_sass/bootstrap/_code.scss +48 -0
  48. data/_sass/bootstrap/_custom-forms.scss +522 -0
  49. data/_sass/bootstrap/_dropdown.scss +192 -0
  50. data/_sass/bootstrap/_forms.scss +347 -0
  51. data/_sass/bootstrap/_functions.scss +141 -0
  52. data/_sass/bootstrap/_grid.scss +77 -0
  53. data/_sass/bootstrap/_images.scss +42 -0
  54. data/_sass/bootstrap/_input-group.scss +192 -0
  55. data/_sass/bootstrap/_jumbotron.scss +17 -0
  56. data/_sass/bootstrap/_list-group.scss +154 -0
  57. data/_sass/bootstrap/_media.scss +8 -0
  58. data/_sass/bootstrap/_mixins.scss +47 -0
  59. data/_sass/bootstrap/_modal.scss +241 -0
  60. data/_sass/bootstrap/_nav.scss +121 -0
  61. data/_sass/bootstrap/_navbar.scss +324 -0
  62. data/_sass/bootstrap/_pagination.scss +74 -0
  63. data/_sass/bootstrap/_popover.scss +170 -0
  64. data/_sass/bootstrap/_print.scss +141 -0
  65. data/_sass/bootstrap/_progress.scss +47 -0
  66. data/_sass/bootstrap/_reboot.scss +480 -0
  67. data/_sass/bootstrap/_root.scss +20 -0
  68. data/_sass/bootstrap/_spinners.scss +56 -0
  69. data/_sass/bootstrap/_tables.scss +185 -0
  70. data/_sass/bootstrap/_toasts.scss +44 -0
  71. data/_sass/bootstrap/_tooltip.scss +115 -0
  72. data/_sass/bootstrap/_transitions.scss +20 -0
  73. data/_sass/bootstrap/_type.scss +125 -0
  74. data/_sass/bootstrap/_utilities.scss +18 -0
  75. data/_sass/bootstrap/_variables.scss +1147 -0
  76. data/_sass/bootstrap/bootstrap-grid.scss +29 -0
  77. data/_sass/bootstrap/bootstrap-reboot.scss +12 -0
  78. data/_sass/bootstrap/bootstrap.scss +44 -0
  79. data/_sass/bootstrap/mixins/_alert.scss +13 -0
  80. data/_sass/bootstrap/mixins/_background-variant.scss +23 -0
  81. data/_sass/bootstrap/mixins/_badge.scss +17 -0
  82. data/_sass/bootstrap/mixins/_border-radius.scss +76 -0
  83. data/_sass/bootstrap/mixins/_box-shadow.scss +20 -0
  84. data/_sass/bootstrap/mixins/_breakpoints.scss +123 -0
  85. data/_sass/bootstrap/mixins/_buttons.scss +110 -0
  86. data/_sass/bootstrap/mixins/_caret.scss +62 -0
  87. data/_sass/bootstrap/mixins/_clearfix.scss +7 -0
  88. data/_sass/bootstrap/mixins/_deprecate.scss +10 -0
  89. data/_sass/bootstrap/mixins/_float.scss +14 -0
  90. data/_sass/bootstrap/mixins/_forms.scss +177 -0
  91. data/_sass/bootstrap/mixins/_gradients.scss +45 -0
  92. data/_sass/bootstrap/mixins/_grid-framework.scss +81 -0
  93. data/_sass/bootstrap/mixins/_grid.scss +69 -0
  94. data/_sass/bootstrap/mixins/_hover.scss +37 -0
  95. data/_sass/bootstrap/mixins/_image.scss +36 -0
  96. data/_sass/bootstrap/mixins/_list-group.scss +21 -0
  97. data/_sass/bootstrap/mixins/_lists.scss +7 -0
  98. data/_sass/bootstrap/mixins/_nav-divider.scss +11 -0
  99. data/_sass/bootstrap/mixins/_pagination.scss +22 -0
  100. data/_sass/bootstrap/mixins/_reset-text.scss +17 -0
  101. data/_sass/bootstrap/mixins/_resize.scss +6 -0
  102. data/_sass/bootstrap/mixins/_screen-reader.scss +34 -0
  103. data/_sass/bootstrap/mixins/_size.scss +7 -0
  104. data/_sass/bootstrap/mixins/_table-row.scss +39 -0
  105. data/_sass/bootstrap/mixins/_text-emphasis.scss +17 -0
  106. data/_sass/bootstrap/mixins/_text-hide.scss +11 -0
  107. data/_sass/bootstrap/mixins/_text-truncate.scss +8 -0
  108. data/_sass/bootstrap/mixins/_transition.scss +26 -0
  109. data/_sass/bootstrap/mixins/_visibility.scss +8 -0
  110. data/_sass/bootstrap/utilities/_align.scss +8 -0
  111. data/_sass/bootstrap/utilities/_background.scss +19 -0
  112. data/_sass/bootstrap/utilities/_borders.scss +75 -0
  113. data/_sass/bootstrap/utilities/_clearfix.scss +3 -0
  114. data/_sass/bootstrap/utilities/_display.scss +26 -0
  115. data/_sass/bootstrap/utilities/_embed.scss +39 -0
  116. data/_sass/bootstrap/utilities/_flex.scss +51 -0
  117. data/_sass/bootstrap/utilities/_float.scss +11 -0
  118. data/_sass/bootstrap/utilities/_interactions.scss +5 -0
  119. data/_sass/bootstrap/utilities/_overflow.scss +5 -0
  120. data/_sass/bootstrap/utilities/_position.scss +32 -0
  121. data/_sass/bootstrap/utilities/_screenreaders.scss +11 -0
  122. data/_sass/bootstrap/utilities/_shadows.scss +6 -0
  123. data/_sass/bootstrap/utilities/_sizing.scss +20 -0
  124. data/_sass/bootstrap/utilities/_spacing.scss +73 -0
  125. data/_sass/bootstrap/utilities/_stretched-link.scss +19 -0
  126. data/_sass/bootstrap/utilities/_text.scss +71 -0
  127. data/_sass/bootstrap/utilities/_visibility.scss +13 -0
  128. data/_sass/bootstrap/vendor/_rfs.scss +204 -0
  129. data/_sass/bootstrapv5-migration.scss +79 -0
  130. data/_sass/chulapa-classes.scss +844 -0
  131. data/_sass/chulapa-master.scss +11 -0
  132. data/_sass/chulapa-misc.scss +105 -0
  133. data/_sass/chulapa-mixins.scss +77 -0
  134. data/_sass/chulapa-vars.scss +48 -0
  135. data/_sass/highlight/README.md +23 -0
  136. data/_sass/highlight/UNLICENSE.txt +24 -0
  137. data/_sass/highlight/autumn.scss +58 -0
  138. data/_sass/highlight/borland.scss +46 -0
  139. data/_sass/highlight/bw.scss +34 -0
  140. data/_sass/highlight/colorful.scss +61 -0
  141. data/_sass/highlight/cran.scss +169 -0
  142. data/_sass/highlight/default.scss +61 -0
  143. data/_sass/highlight/dracula.scss +169 -0
  144. data/_sass/highlight/emacs.scss +61 -0
  145. data/_sass/highlight/friendly.scss +61 -0
  146. data/_sass/highlight/fruity.scss +70 -0
  147. data/_sass/highlight/github.scss +61 -0
  148. data/_sass/highlight/gruvbox.light.scss +84 -0
  149. data/_sass/highlight/manni.scss +61 -0
  150. data/_sass/highlight/monokai.scss +65 -0
  151. data/_sass/highlight/murphy.scss +61 -0
  152. data/_sass/highlight/native.scss +70 -0
  153. data/_sass/highlight/pastie.scss +60 -0
  154. data/_sass/highlight/perldoc.scss +58 -0
  155. data/_sass/highlight/skeletor.scss +140 -0
  156. data/_sass/highlight/tango.scss +69 -0
  157. data/_sass/highlight/thankful_eyes.scss +173 -0
  158. data/_sass/highlight/trac.scss +59 -0
  159. data/_sass/highlight/vim.scss +70 -0
  160. data/_sass/highlight/vs.scss +33 -0
  161. data/_sass/highlight/zenburn.scss +136 -0
  162. data/_sass/reset-algolia.scss +24 -0
  163. data/_sass/skins/academia.scss +26 -0
  164. data/_sass/skins/auto.scss +26 -0
  165. data/_sass/skins/chulapa.scss +52 -0
  166. data/_sass/skins/deeply.scss +89 -0
  167. data/_sass/skins/graymor.scss +26 -0
  168. data/_sass/skins/hootstrap.scss +17 -0
  169. data/_sass/skins/journal.scss +142 -0
  170. data/_sass/skins/lux.scss +377 -0
  171. data/_sass/skins/lymcha.scss +14 -0
  172. data/_sass/skins/minty.scss +165 -0
  173. data/_sass/skins/none.scss +2 -0
  174. data/_sass/skins/pear.scss +21 -0
  175. data/_sass/skins/preptor.scss +19 -0
  176. data/_sass/skins/sketchy.scss +745 -0
  177. data/_sass/skins/sunset.scss +14 -0
  178. data/_sass/skins/twitter-dim.scss +30 -0
  179. data/_sass/skins/twitter-lights-out.scss +31 -0
  180. data/_sass/skins/twitter.scss +30 -0
  181. data/_sass/skins/universal.scss +24 -0
  182. data/_sass/skins/wandoo.scss +15 -0
  183. data/assets/atom.xml +72 -0
  184. data/assets/css/custom.scss +4 -0
  185. data/assets/css/highlighter.scss +5 -0
  186. data/assets/css/main.scss +35 -0
  187. data/assets/fonts/Chulapa/Chulapa-Bold.otf +0 -0
  188. data/assets/fonts/Chulapa/Chulapa-Bold_v2.1.otf +0 -0
  189. data/assets/fonts/Chulapa/Chulapa-Bold_v2.2.otf +0 -0
  190. data/assets/fonts/Chulapa/Chulapa-Bold_v2.otf +0 -0
  191. data/assets/fonts/Chulapa/Chulapa-Bold_vmod.otf +0 -0
  192. data/assets/fonts/Chulapa/Chulapa-Light.otf +0 -0
  193. data/assets/fonts/Chulapa/Chulapa-Regular.otf +0 -0
  194. data/assets/fonts/Chulapa/LICENCIA DE USO.txt +2 -0
  195. data/assets/fonts/Ferpal/Ferpal-Regular.otf +0 -0
  196. data/assets/js/algolia/algolia-search.js +148 -0
  197. data/assets/js/ch_ytdefer/ch_ytdefer.js +81 -0
  198. data/assets/js/ch_ytdefer/ch_ytdefer.min.js +1 -0
  199. data/assets/js/clipboardrouge.js +95 -0
  200. data/assets/js/google/google-search.js +24 -0
  201. data/assets/js/lunr/lunr-search.js +122 -0
  202. data/assets/js/lunr/lunr-store.js +35 -0
  203. data/assets/rss.xml +65 -0
  204. metadata +356 -0
@@ -0,0 +1,204 @@
1
+ // stylelint-disable property-blacklist, scss/dollar-variable-default
2
+
3
+ // SCSS RFS mixin
4
+ //
5
+ // Automated font-resizing
6
+ //
7
+ // See https://github.com/twbs/rfs
8
+
9
+ // Configuration
10
+
11
+ // Base font size
12
+ $rfs-base-font-size: 1.25rem !default;
13
+ $rfs-font-size-unit: rem !default;
14
+
15
+ // Breakpoint at where font-size starts decreasing if screen width is smaller
16
+ $rfs-breakpoint: 1200px !default;
17
+ $rfs-breakpoint-unit: px !default;
18
+
19
+ // Resize font-size based on screen height and width
20
+ $rfs-two-dimensional: false !default;
21
+
22
+ // Factor of decrease
23
+ $rfs-factor: 10 !default;
24
+
25
+ @if type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
26
+ @error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
27
+ }
28
+
29
+ // Generate enable or disable classes. Possibilities: false, "enable" or "disable"
30
+ $rfs-class: false !default;
31
+
32
+ // 1 rem = $rfs-rem-value px
33
+ $rfs-rem-value: 16 !default;
34
+
35
+ // Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
36
+ $rfs-safari-iframe-resize-bug-fix: false !default;
37
+
38
+ // Disable RFS by setting $enable-responsive-font-sizes to false
39
+ $enable-responsive-font-sizes: true !default;
40
+
41
+ // Cache $rfs-base-font-size unit
42
+ $rfs-base-font-size-unit: unit($rfs-base-font-size);
43
+
44
+ // Remove px-unit from $rfs-base-font-size for calculations
45
+ @if $rfs-base-font-size-unit == "px" {
46
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1);
47
+ }
48
+ @else if $rfs-base-font-size-unit == "rem" {
49
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
50
+ }
51
+
52
+ // Cache $rfs-breakpoint unit to prevent multiple calls
53
+ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
54
+
55
+ // Remove unit from $rfs-breakpoint for calculations
56
+ @if $rfs-breakpoint-unit-cache == "px" {
57
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
58
+ }
59
+ @else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
60
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
61
+ }
62
+
63
+ // Responsive font-size mixin
64
+ @mixin rfs($fs, $important: false) {
65
+ // Cache $fs unit
66
+ $fs-unit: if(type-of($fs) == "number", unit($fs), false);
67
+
68
+ // Add !important suffix if needed
69
+ $rfs-suffix: if($important, " !important", "");
70
+
71
+ // If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
72
+ @if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
73
+ font-size: #{$fs}#{$rfs-suffix};
74
+ }
75
+ @else {
76
+ // Variables for storing static and fluid rescaling
77
+ $rfs-static: null;
78
+ $rfs-fluid: null;
79
+
80
+ // Remove px-unit from $fs for calculations
81
+ @if $fs-unit == "px" {
82
+ $fs: $fs / ($fs * 0 + 1);
83
+ }
84
+ @else if $fs-unit == "rem" {
85
+ $fs: $fs / ($fs * 0 + 1 / $rfs-rem-value);
86
+ }
87
+
88
+ // Set default font-size
89
+ @if $rfs-font-size-unit == rem {
90
+ $rfs-static: #{$fs / $rfs-rem-value}rem#{$rfs-suffix};
91
+ }
92
+ @else if $rfs-font-size-unit == px {
93
+ $rfs-static: #{$fs}px#{$rfs-suffix};
94
+ }
95
+ @else {
96
+ @error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
97
+ }
98
+
99
+ // Only add media query if font-size is bigger as the minimum font-size
100
+ // If $rfs-factor == 1, no rescaling will take place
101
+ @if $fs > $rfs-base-font-size and $enable-responsive-font-sizes {
102
+ $min-width: null;
103
+ $variable-unit: null;
104
+
105
+ // Calculate minimum font-size for given font-size
106
+ $fs-min: $rfs-base-font-size + ($fs - $rfs-base-font-size) / $rfs-factor;
107
+
108
+ // Calculate difference between given font-size and minimum font-size for given font-size
109
+ $fs-diff: $fs - $fs-min;
110
+
111
+ // Base font-size formatting
112
+ // No need to check if the unit is valid, because we did that before
113
+ $min-width: if($rfs-font-size-unit == rem, #{$fs-min / $rfs-rem-value}rem, #{$fs-min}px);
114
+
115
+ // If two-dimensional, use smallest of screen width and height
116
+ $variable-unit: if($rfs-two-dimensional, vmin, vw);
117
+
118
+ // Calculate the variable width between 0 and $rfs-breakpoint
119
+ $variable-width: #{$fs-diff * 100 / $rfs-breakpoint}#{$variable-unit};
120
+
121
+ // Set the calculated font-size.
122
+ $rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
123
+ }
124
+
125
+ // Rendering
126
+ @if $rfs-fluid == null {
127
+ // Only render static font-size if no fluid font-size is available
128
+ font-size: $rfs-static;
129
+ }
130
+ @else {
131
+ $mq-value: null;
132
+
133
+ // RFS breakpoint formatting
134
+ @if $rfs-breakpoint-unit == em or $rfs-breakpoint-unit == rem {
135
+ $mq-value: #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit};
136
+ }
137
+ @else if $rfs-breakpoint-unit == px {
138
+ $mq-value: #{$rfs-breakpoint}px;
139
+ }
140
+ @else {
141
+ @error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
142
+ }
143
+
144
+ @if $rfs-class == "disable" {
145
+ // Adding an extra class increases specificity,
146
+ // which prevents the media query to override the font size
147
+ &,
148
+ .disable-responsive-font-size &,
149
+ &.disable-responsive-font-size {
150
+ font-size: $rfs-static;
151
+ }
152
+ }
153
+ @else {
154
+ font-size: $rfs-static;
155
+ }
156
+
157
+ @if $rfs-two-dimensional {
158
+ @media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
159
+ @if $rfs-class == "enable" {
160
+ .enable-responsive-font-size &,
161
+ &.enable-responsive-font-size {
162
+ font-size: $rfs-fluid;
163
+ }
164
+ }
165
+ @else {
166
+ font-size: $rfs-fluid;
167
+ }
168
+
169
+ @if $rfs-safari-iframe-resize-bug-fix {
170
+ // stylelint-disable-next-line length-zero-no-unit
171
+ min-width: 0vw;
172
+ }
173
+ }
174
+ }
175
+ @else {
176
+ @media (max-width: #{$mq-value}) {
177
+ @if $rfs-class == "enable" {
178
+ .enable-responsive-font-size &,
179
+ &.enable-responsive-font-size {
180
+ font-size: $rfs-fluid;
181
+ }
182
+ }
183
+ @else {
184
+ font-size: $rfs-fluid;
185
+ }
186
+
187
+ @if $rfs-safari-iframe-resize-bug-fix {
188
+ // stylelint-disable-next-line length-zero-no-unit
189
+ min-width: 0vw;
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ // The font-size & responsive-font-size mixin uses RFS to rescale font sizes
198
+ @mixin font-size($fs, $important: false) {
199
+ @include rfs($fs, $important);
200
+ }
201
+
202
+ @mixin responsive-font-size($fs, $important: false) {
203
+ @include rfs($fs, $important);
204
+ }
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * Bootstrap v5 migration
3
+ */
4
+
5
+ .g-0 {
6
+ @extend .no-gutters;
7
+ }
8
+
9
+ .rounded-pill {
10
+ padding-right: $badge-pill-padding-x;
11
+ padding-left: $badge-pill-padding-x;
12
+ @include border-radius($badge-pill-border-radius);
13
+ }
14
+
15
+
16
+ // The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
17
+ // See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
18
+ $min-contrast-ratio: 3 !default;
19
+
20
+ // Customize the light and dark text colors for use in our color contrast function.
21
+ $color-contrast-dark: $gray-900 !default;
22
+ $color-contrast-light: $white !default;
23
+
24
+ // A list of pre-calculated numbers of pow(($value / 255 + .055) / 1.055, 2.4). (from 0 to 255)
25
+ // stylelint-disable-next-line scss/dollar-variable-default, scss/dollar-variable-pattern
26
+ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044 .0048 .0052 .0056 .006 .0065 .007 .0075 .008 .0086 .0091 .0097 .0103 .011 .0116 .0123 .013 .0137 .0144 .0152 .016 .0168 .0176 .0185 .0194 .0203 .0212 .0222 .0232 .0242 .0252 .0262 .0273 .0284 .0296 .0307 .0319 .0331 .0343 .0356 .0369 .0382 .0395 .0409 .0423 .0437 .0452 .0467 .0482 .0497 .0513 .0529 .0545 .0561 .0578 .0595 .0612 .063 .0648 .0666 .0685 .0704 .0723 .0742 .0762 .0782 .0802 .0823 .0844 .0865 .0887 .0908 .0931 .0953 .0976 .0999 .1022 .1046 .107 .1095 .1119 .1144 .117 .1195 .1221 .1248 .1274 .1301 .1329 .1356 .1384 .1413 .1441 .147 .15 .1529 .1559 .159 .162 .1651 .1683 .1714 .1746 .1779 .1812 .1845 .1878 .1912 .1946 .1981 .2016 .2051 .2086 .2122 .2159 .2195 .2232 .227 .2307 .2346 .2384 .2423 .2462 .2502 .2542 .2582 .2623 .2664 .2705 .2747 .2789 .2831 .2874 .2918 .2961 .3005 .305 .3095 .314 .3185 .3231 .3278 .3325 .3372 .3419 .3467 .3515 .3564 .3613 .3663 .3712 .3763 .3813 .3864 .3916 .3968 .402 .4072 .4125 .4179 .4233 .4287 .4342 .4397 .4452 .4508 .4564 .4621 .4678 .4735 .4793 .4851 .491 .4969 .5029 .5089 .5149 .521 .5271 .5333 .5395 .5457 .552 .5583 .5647 .5711 .5776 .5841 .5906 .5972 .6038 .6105 .6172 .624 .6308 .6376 .6445 .6514 .6584 .6654 .6724 .6795 .6867 .6939 .7011 .7084 .7157 .7231 .7305 .7379 .7454 .7529 .7605 .7682 .7758 .7835 .7913 .7991 .807 .8148 .8228 .8308 .8388 .8469 .855 .8632 .8714 .8796 .8879 .8963 .9047 .9131 .9216 .9301 .9387 .9473 .956 .9647 .9734 .9823 .9911 1;
27
+
28
+ @function color-contrast($background, $color-contrast-dark: $color-contrast-dark, $color-contrast-light: $color-contrast-light, $min-contrast-ratio: $min-contrast-ratio) {
29
+ $foregrounds: $color-contrast-light, $color-contrast-dark, $white, $black;
30
+ $max-ratio: 0;
31
+ $max-ratio-color: null;
32
+
33
+ @each $color in $foregrounds {
34
+ $contrast-ratio: contrast-ratio($background, $color);
35
+
36
+ @if $contrast-ratio>$min-contrast-ratio {
37
+ @return $color;
38
+ }
39
+
40
+ @else if $contrast-ratio>$max-ratio {
41
+ $max-ratio: $contrast-ratio;
42
+ $max-ratio-color: $color;
43
+ }
44
+ }
45
+
46
+ @warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}…";
47
+
48
+ @return $max-ratio-color;
49
+ }
50
+
51
+ @function contrast-ratio($background, $foreground: $color-contrast-light) {
52
+ $l1: luminance($background);
53
+ $l2: luminance(opaque($background, $foreground));
54
+
55
+ @return if($l1 > $l2, ($l1 + .05) / ($l2 + .05), ($l2 + .05) / ($l1 + .05));
56
+ }
57
+
58
+ // Return WCAG2.0 relative luminance
59
+ // See https://www.w3.org/WAI/GL/wiki/Relative_luminance
60
+ // See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
61
+ @function luminance($color) {
62
+ $rgb: ("r": red($color),
63
+ "g": green($color),
64
+ "b": blue($color));
65
+
66
+ @each $name,
67
+ $value in $rgb {
68
+ $value: if($value / 255 < .03928, $value / 255 / 12.92, nth($_luminance-list, $value + 1));
69
+ $rgb: map-merge($rgb, ($name: $value));
70
+ }
71
+
72
+ @return (map-get($rgb, "r") * .2126)+(map-get($rgb, "g") * .7152)+(map-get($rgb, "b") * .0722);
73
+ }
74
+
75
+ // Return opaque color
76
+ // opaque(#fff, rgba(0, 0, 0, .5)) => #808080
77
+ @function opaque($background, $foreground) {
78
+ @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
79
+ }