jekyll-theme-centos 2.52.0.beta.78 → 2.52.0.beta.79

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbe756786a2e1582e88c6e174721d3f3457d81aa5d9ea4846e8b53ff0bca3a19
4
- data.tar.gz: b9e9098fde19be75627b7f3239825b7aa3fc5daad2bcd8e1f7180c4d5cabc0a4
3
+ metadata.gz: 1b990c61640d3b32c7cbd850d7a2cefd242c7dc294441e900cd5ba58c799f265
4
+ data.tar.gz: 4d4dee0ce7d789549891d898f6e319298a1e43b7d91a333e05837d2b4f347646
5
5
  SHA512:
6
- metadata.gz: f4e02695884ce448834ffe7a961d5b8905a1cf8cb4367935f8a8566c10403da74dd7d05c9976f2f1ac9ac10e2e3a1d53c6f0be314ddb4310f299c8b7521491de
7
- data.tar.gz: 3069b56eca0abfed57106906af11cc84e6c8b9b236889ce4d8333a14e8925b1c4ddd47b3fb9fa3cd01df2881b231db684c43b72bc196569b79e4668a22399c6f
6
+ metadata.gz: '0983a61c93b725fbb45ae64b5b51e2314dc6e984784ca9ed1ec216a85eaa867b9cc7e36a342351978a441f59b3cbb165df970991873d5efcebef390a05c63dbd'
7
+ data.tar.gz: 1340c3efc761f3991f2440a47bbdba2c023f9a050765dc8093dfea21bce956e7e0d737a9551e1cff8833c5ae73dec0cab6b2e49ed48d9003dc55415053d57412
@@ -18,13 +18,16 @@
18
18
  {%- else %}
19
19
  {%- assign _item_name = item.name %}
20
20
  {%- endif %}
21
+ {%- assign _webaim_fcolor = item.text_color_hex | remove: '#' | upcase %}
22
+ {%- assign _webaim_bcolor = item.hex | remove: '#' | upcase %}
23
+ {%- capture _webaim_link %}https://webaim.org/resources/contrastchecker/?fcolor={{ _webaim_fcolor }}&bcolor={{ _webaim_bcolor }}{%- endcapture %}
21
24
  <tr>
22
25
  <td class="text-nowrap">{{ _item_name }}</td>
23
26
  <td class="text-nowrap"><i class="fas fa-circle fa-xl" style="color: {{ item.hex }}"></i><span role="button" class="copy-btn" data-bs-toggle="tooltip" data-bs-title="Copy hex value" data-copy-value="{{ item.hex }}" aria-label="Copy hex value {{ item.hex }}"><code>{{ item.hex }}</code> <span class="fa-regular fa-copy"></span></span></td>
24
27
  <td class="text-nowrap"><span role="button" class="copy-btn" data-bs-toggle="tooltip" data-bs-title="Copy RGB value" data-copy-value="{{ item.rgb }}" aria-label="Copy RGB value {{ item.rgb }}"><code>{{ item.rgb }}</code> <span class="fa-regular fa-copy"></span></span></td>
25
28
  <td class="text-nowrap"><span role="button" class="copy-btn" data-bs-toggle="tooltip" data-bs-title="Copy HSV value" data-copy-value="{{ item.hsv }}" aria-label="Copy HSV value {{ item.hsv }}"><code>{{ item.hsv }}</code> <span class="fa-regular fa-copy"></span></span></td>
26
29
  <td><span class="badge {{ item.text_badge }}">{{ item.text_color }}</span></td>
27
- <td class="text-nowrap"><code>{{ item.contrast_ratio | remove: '`' }}</code> <a href="https://webaim.org/resources/contrastchecker/?fcolor={{ item.text_color_hex | remove: '#' | upcase }}&bcolor={{ item.hex | remove: '#' | upcase }}" target="_blank" class="text-decoration-none" data-bs-toggle="tooltip" title="Verify with WebAIM" aria-label="Verify contrast ratio with WebAIM"><i class="fas fa-external-link-alt"></i></a></td>
30
+ <td class="text-nowrap"><code>{{ item.contrast_ratio | remove: '`' }}</code> {% include base/link.html.liquid link=_webaim_link target="_blank" class="text-decoration-none" icon="fas fa-external-link-alt" data_bs_toggle="tooltip" data_bs_title="Verify with WebAIM" aria_label="Verify contrast ratio with WebAIM" %}</td>
28
31
  <td class="text-nowrap">{% if item.wcag_2_2_aa %}<span class="d-inline-block" data-bs-toggle="tooltip" title="Exceeds WCAG 2.2 AA standard (4.5:1 minimum)"><i class="fas fa-circle-check text-success"></i></span>{% else %}<span class="d-inline-block" data-bs-toggle="tooltip" title="Underperforms WCAG 2.2 AA standard (4.5:1 minimum)"><i class="fas fa-circle-xmark text-danger"></i></span>{% endif %} <code>{{ item.wcag_2_2_aa_margin | remove: '`' }}</code></td>
29
32
  <td class="text-nowrap">{% if item.wcag_2_2_aaa %}<span class="d-inline-block" data-bs-toggle="tooltip" title="Exceeds WCAG 2.2 AAA standard (7.0:1 minimum)"><i class="fas fa-circle-check text-success"></i></span>{% else %}<span class="d-inline-block" data-bs-toggle="tooltip" title="Underperforms WCAG 2.2 AAA standard (7.0:1 minimum)"><i class="fas fa-circle-xmark text-danger"></i></span>{% endif %} <code>{{ item.wcag_2_2_aaa_margin | remove: '`' }}</code></td>
30
33
  </tr>
@@ -2,18 +2,29 @@
2
2
  ================================================================================
3
3
  Template: Copy Value Component
4
4
  Purpose: Copy to clipboard with visual feedback (checkmark + tooltip).
5
- Auto-detects and handles both escaped and unescaped values.
5
+ Decodes HTML-entity-escaped values back to plain text before copying.
6
6
  ================================================================================
7
7
 
8
- Recommended Usage (in template):
8
+ Required Usage (in template):
9
9
  <span role="button" class="copy-btn" data-copy-value="{{ command | escape }}"
10
10
  data-bs-toggle="tooltip" data-bs-title="Copy command">
11
11
  <span class="fa-regular fa-copy"></span>
12
12
  </span>
13
13
 
14
+ SECURITY — `data-copy-value` MUST always go through Liquid's `| escape` (or
15
+ equivalent HTML-attribute encoding) at the point where it is written, with no
16
+ exception for values that "look safe". The JS below decodes HTML entities
17
+ (&quot;, &amp;, &#39;, …) back to plain text before copying so the clipboard
18
+ receives the original string rather than its escaped form — this decoding is
19
+ a UX convenience, not sanitization, and provides no protection if the value
20
+ was interpolated unescaped in the first place. An unescaped, attacker-
21
+ influenced value (a query parameter, CMS field, etc.) placed directly in
22
+ data-copy-value breaks out of the HTML attribute at render time, before this
23
+ script ever runs.
24
+
14
25
  Strategic Design Logic:
15
- - Armored implementation: handles escaped and unescaped values
16
- - HTML entity detection: decodes &quot;, &amp;, &#39; automatically
26
+ - HTML entity decoding: reverses &quot;, &amp;, &#39; encoding so the
27
+ clipboard receives plain text, independent of how the value was escaped
17
28
  - Visual feedback: checkmark icon + success tooltip
18
29
  - Auto-reset: returns to original state after delay
19
30
  - Clipboard API: native browser copy functionality
@@ -2,7 +2,11 @@
2
2
  // Reads configuration from data attributes on this script tag
3
3
  // Applied via backtotop.html.liquid template with data attributes
4
4
 
5
- (function () {
5
+ // This script tag lives in <head>, before <body> exists. defer normally
6
+ // delays execution until after parsing, but consumers that inline this
7
+ // file (e.g. monolith bundling) drop the src that defer depends on, so the
8
+ // wait for DOMContentLoaded is done explicitly instead of relying on it.
9
+ document.addEventListener('DOMContentLoaded', () => {
6
10
  const scriptTag = document.getElementById('centos-backtop')
7
11
 
8
12
  if (!scriptTag) {
@@ -17,4 +21,4 @@
17
21
  }
18
22
 
19
23
  addBackToTop(config)
20
- })()
24
+ })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-centos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.52.0.beta.78
4
+ version: 2.52.0.beta.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alain Reguera Delgado