jekyll-theme-centos 2.52.0.beta.102 → 2.52.0.beta.104

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/_data/base/announcement_schema.yml +0 -1
  3. data/_data/base/backtotop_schema.yml +7 -4
  4. data/_data/base/calendar_schema.yml +6 -4
  5. data/_data/base/card_schema.yml +2 -2
  6. data/_data/base/copyright_schema.yml +1 -1
  7. data/_data/base/datatable_schema.yml +8 -6
  8. data/_data/base/fontawesome_schema.yml +10 -2
  9. data/_data/base/heading_anchor.yml +1 -1
  10. data/_data/base/heading_anchor_schema.yml +1 -1
  11. data/_data/base/highlight_schema.yml +1433 -60
  12. data/_data/base/link_schema.yml +1 -1
  13. data/_data/base/preview_schema.yml +88 -0
  14. data/_data/base/project.yml +1 -1
  15. data/_includes/base/color-table.html.liquid +4 -4
  16. data/_includes/base/configuration_variables-default-cell.html.liquid +83 -0
  17. data/_includes/base/configuration_variables-nested.html.liquid +4 -11
  18. data/_includes/base/configuration_variables.html.liquid +3 -11
  19. data/_includes/base/copyvalue.html.liquid +23 -17
  20. data/_includes/base/download_architecture.html.liquid +13 -11
  21. data/_includes/base/download_documentation.html.liquid +1 -1
  22. data/_includes/base/download_filevalue.html.liquid +1 -1
  23. data/_includes/base/footer.html.liquid +1 -1
  24. data/_includes/base/head.html.liquid +12 -10
  25. data/_includes/base/highlight.html.liquid +40 -50
  26. data/_includes/base/navbar.html.liquid +4 -4
  27. data/_includes/base/preview.html.liquid +119 -0
  28. data/_sass/base/_calendar.scss +2 -1
  29. data/_sass/base/_customization.scss +61 -52
  30. data/_sass/base/_highlight-theme.scss +102 -0
  31. data/_sass/base/_preview.scss +74 -0
  32. data/_sass/base/_theme-colors.scss +8 -5
  33. data/_sass/base/_variables.scss +55 -73
  34. data/assets/css/base/stylesheet.min.scss +3 -1
  35. data/assets/js/base/backtotop.js +2 -2
  36. data/assets/js/base/copyvalue.js +3 -0
  37. data/assets/js/base/datatable.js +27 -9
  38. data/assets/js/base/highlight.js +86 -12
  39. metadata +6 -1
@@ -1,23 +1,24 @@
1
1
  {% comment %}
2
2
  ================================================================================
3
3
  Template: Highlight.js Code Syntax Highlighting Component
4
- Purpose: Loads Highlight.js library CSS and JavaScript from CDN with
5
- copy-to-clipboard functionality for code blocks.
6
- ================================================================================
4
+ Purpose: Loads Highlight.js from a CDN to color code blocks in the browser.
5
+
6
+ This template only loads the JS library. It never loads a CSS theme file —
7
+ the colors come from this site's own theme, _highlight-theme.scss, already
8
+ part of the compiled stylesheet. It also doesn't add a copy button; that's
9
+ base/highlight.js's job, which wraps every code block (plain Markdown or
10
+ one built with base/preview.html.liquid) in the same toolbar, reusing the
11
+ site-wide `.copy-btn` handler (src/JS/copyvalue.js).
7
12
 
8
- Design Logic:
9
- - CDN-based library: Highlight.js from cdnjs
10
- - Copy plugin: additional plugin for code clipboard functionality
11
- - Format switching: separate head (CSS) and script (JS) includes
12
- - Automatic initialization: on document load
13
- - Configurable theme: different color schemes available
14
- - 190+ languages supported
13
+ Cdnjs's default build covers about 40 common languages. A block whose
14
+ language isn't in that build renders as plain, uncolored text instead of
15
+ erroring. Load any other language by setting
16
+ with_highlight_data.languages.<id>: true in a page's front matter — see
17
+ src/YAML/highlight_schema.yml for the full list of language ids.
15
18
 
16
19
  Optional Inputs:
17
- - type: "head" for CSS, "script" for JavaScript
18
- - theme: Syntax highlighting theme (default: "default")
19
- - version: Highlight.js version (e.g., "11.9.0")
20
- - data: Highlight.js configuration object
20
+ - data: Highlight.js configuration object — version, script_integrity,
21
+ and languages (see above)
21
22
 
22
23
  Data Source Hierarchy (priority):
23
24
  1. include.data
@@ -41,44 +42,33 @@ Data Source Hierarchy (priority):
41
42
 
42
43
  {%- if with_highlight %}
43
44
 
44
- {%- assign highlight_theme = with_highlight_data.theme | default: with_highlight_schema.theme.default %}
45
- {%- assign highlight_version = with_highlight_data.version | default: with_highlight_schema.version.default %}
46
- {%- assign highlight_css_sri = with_highlight_data.css_integrity | default: with_highlight_schema.css_integrity.default %}
47
- {%- assign highlight_script_sri = with_highlight_data.script_integrity | default: with_highlight_schema.script_integrity.default %}
48
- {%- assign copy_version = with_highlight_data.copy_version | default: with_highlight_schema.copy_version.default %}
49
- {%- assign copy_script_sri = with_highlight_data.copy_script_integrity | default: with_highlight_schema.copy_script_integrity.default %}
50
- {%- assign copy_css_sri = with_highlight_data.copy_css_integrity | default: with_highlight_schema.copy_css_integrity.default %}
51
- {%- assign copy_icon_svg = with_highlight_data.copy_button_icons.copy.svg | default: with_highlight_schema.copy_button_icons.properties.copy.properties.svg.default %}
52
- {%- assign success_icon_svg = with_highlight_data.copy_button_icons.success.svg | default: with_highlight_schema.copy_button_icons.properties.success.properties.svg.default %}
45
+ {%- assign highlight_version = with_highlight_data.version | default: with_highlight_schema.version.default %}
46
+ {%- assign highlight_script_sri = with_highlight_data.script_integrity | default: with_highlight_schema.script_integrity.default %}
53
47
 
54
- {%- capture html_highlight_head %}
55
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/{{ highlight_version }}/styles/{{ highlight_theme | replace_first: 'base16-', 'base16/' | default: 'default' }}.min.css" integrity="{{ highlight_css_sri }}" crossorigin="anonymous" referrerpolicy="no-referrer" />
56
- <link rel="stylesheet" href="https://unpkg.com/highlightjs-copy@{{ copy_version }}/dist/highlightjs-copy.min.css" integrity="{{ copy_css_sri }}" crossorigin="anonymous" referrerpolicy="no-referrer" />
57
- <!-- Highlight.js Copy Button Icon Customization (from schema) -->
58
- <style>
59
- .hljs-copy-button:not([data-copied="true"])::before {
60
- mask: url('data:image/svg+xml;utf-8,{{ copy_icon_svg }}');
61
- }
62
- .hljs-copy-button[data-copied='true']::after {
63
- background-image: url('data:image/svg+xml;utf-8,{{ success_icon_svg }}');
64
- }
65
- </style>
66
- {%- endcapture %}
48
+ <!-- Highlight.js Library -->
49
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/{{ highlight_version }}/highlight.min.js" integrity="{{ highlight_script_sri }}" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
67
50
 
68
- {%- capture html_highlight_script %}
69
- <!-- Highlight.js Library and Copy Plugin -->
70
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/{{ highlight_version }}/highlight.min.js" integrity="{{ highlight_script_sri }}" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
71
- <script src="https://unpkg.com/highlightjs-copy@{{ copy_version }}/dist/highlightjs-copy.min.js" integrity="{{ copy_script_sri }}" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
72
- <!-- Initialize Highlight.js -->
73
- <script src="{{ site.baseurl }}/assets/js/base/highlight.min.js" defer></script>
74
- {%- endcapture %}
51
+ {%- comment %}
52
+ Optional per-language modules. Each script tag must come after the core
53
+ library above, so its `hljs.registerLanguage` call has a global `hljs` to
54
+ register against. A language's toggle lives in with_highlight_data.languages,
55
+ set in a page's front matter. Its SRI hash comes from the schema's own
56
+ x_integrity map — a page only names the languages it wants, never their
57
+ hashes.
58
+ {%- endcomment %}
59
+ {%- assign highlight_languages = with_highlight_data.languages %}
60
+ {%- assign language_integrity = with_highlight_schema.languages.properties.x_integrity.properties %}
61
+ {%- if highlight_languages %}
62
+ {%- for language in highlight_languages %}
63
+ {%- assign language_id = language[0] %}
64
+ {%- assign language_enabled = language[1] %}
65
+ {%- if language_enabled %}
66
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/{{ highlight_version }}/languages/{{ language_id }}.min.js" integrity="{{ language_integrity[language_id].default }}" crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
67
+ {%- endif %}
68
+ {%- endfor %}
69
+ {%- endif %}
75
70
 
76
- {%- assign type = include.type %}
77
- {%- case type %}
78
- {%- when "head" %}
79
- {{ html_highlight_head }}
80
- {%- when "script" %}
81
- {{ html_highlight_script }}
82
- {%- endcase %}
71
+ <!-- Initialize Highlight.js and wrap code blocks in the shared preview toolbar -->
72
+ <script src="{{ site.baseurl }}/assets/js/base/highlight.min.js" defer></script>
83
73
 
84
74
  {%- endif %}
@@ -58,7 +58,7 @@ Data Source Hierarchy (priority):
58
58
 
59
59
  {%- if navbar_brand_image != "" %}
60
60
  {%- assign navbar_brand_link = "/" | locale_url: page.locale %}
61
- <a class="navbar-brand" href="{{ site.baseurl }}{{ navbar_brand_link }}">
61
+ <a class="navbar-brand focus-ring" href="{{ site.baseurl }}{{ navbar_brand_link }}">
62
62
 
63
63
  <img
64
64
  class="d-inline-block align-text-middle me-2{% if navbar_brand_image_class != "" %} {{ navbar_brand_image_class }}{% endif %}"
@@ -85,7 +85,7 @@ Data Source Hierarchy (priority):
85
85
  {%- if navitem.menu.size == 0 %}
86
86
  <li class="nav-item">
87
87
  {%- include base/link.html.liquid
88
- class = "nav-link"
88
+ class = "nav-link focus-ring"
89
89
  name = navitem.name
90
90
  link = navitem_link
91
91
  role = "presentation"
@@ -94,7 +94,7 @@ Data Source Hierarchy (priority):
94
94
  </li>
95
95
  {%- else %}
96
96
  <li class="nav-item dropdown">
97
- <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown-{{ forloop.index }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
97
+ <a class="nav-link dropdown-toggle focus-ring" href="#" id="navbarDropdown-{{ forloop.index }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
98
98
  <i class="{{ navitem.icon }} me-1" aria-hidden="true"></i>{{ navitem.name }}
99
99
  </a>
100
100
  <ul class="dropdown-menu dropdown-menu-dark shadow">
@@ -102,7 +102,7 @@ Data Source Hierarchy (priority):
102
102
  {%- assign dropdownitem_link = dropdownitem.link | locale_url: page.locale %}
103
103
  <li>
104
104
  {%- include base/link.html.liquid
105
- class = "dropdown-item"
105
+ class = "dropdown-item focus-ring"
106
106
  name = dropdownitem.name
107
107
  link = dropdownitem_link
108
108
  role = "presentation"
@@ -0,0 +1,119 @@
1
+ {% comment %}
2
+ ================================================================================
3
+ Template: Preview Box Component
4
+ Purpose: Puts a live demo, a toolbar, and a code sample in one bordered
5
+ box, as up to three stacked rows.
6
+
7
+ Behavior:
8
+ - Pass `language` or `code`, and the template renders all three rows —
9
+ demo (`.preview-content`), toolbar with a language label and copy
10
+ button (`.preview-toolbar`), and code (`.preview-code`) — wrapped in
11
+ `<div class="preview ...">`. A row with nothing to show is skipped.
12
+ - Pass neither, and the template renders a single plain
13
+ `<div class="{{ class }}">{{ content }}</div>`, so a caller that only
14
+ needs a demo wrapper gets one without a toolbar or code row.
15
+ - Each render mode has its own default outer-box styling (padded and
16
+ tinted for the plain fallback, bordered and flush for the three-row
17
+ box). A `class` the caller passes replaces that default entirely.
18
+ - The copy button reuses the site-wide `.copy-btn` click handler
19
+ (src/JS/copyvalue.js), loaded by copyvalue.html.liquid.
20
+ - Highlight.js colors the code; this template only adds the
21
+ `language-{{ language }}` class the highlighter reads. The toolbar
22
+ label shows uppercase through `language_class`'s `text-uppercase`; the
23
+ value passed in stays lowercase to match that class.
24
+
25
+ Optional Inputs:
26
+ - class: CSS classes for the outer `<div>`.
27
+ - content / content_class: The demo row's HTML (a caller-built `capture`
28
+ block) and its wrapper's classes.
29
+ - language / language_class: The toolbar's language label and its
30
+ classes. Also becomes the `language-{{ language }}` class on the code
31
+ row's `<code>` tag.
32
+ - copy_class: Extra classes on the copy button. Use `d-none` to hide it
33
+ without removing `code`. Only shows when `code` is set.
34
+ - code / code_class: The code row's raw text (HTML-escaped automatically)
35
+ and its wrapper's classes.
36
+ ================================================================================
37
+ {% endcomment %}
38
+
39
+ {%- assign with_preview_schema = site.data.base.preview_schema.properties %}
40
+
41
+ {%- assign preview_class = include.class | default: with_preview_schema.class.default %}
42
+ {%- assign preview_content = include.content | default: with_preview_schema.content.default %}
43
+ {%- assign preview_content_class = include.content_class | default: with_preview_schema.content_class.default %}
44
+ {%- assign preview_language = include.language | default: with_preview_schema.language.default %}
45
+ {%- assign preview_language_class = include.language_class | default: with_preview_schema.language_class.default %}
46
+ {%- assign preview_copy_class = include.copy_class | default: with_preview_schema.copy_class.default %}
47
+ {%- assign preview_code = include.code | default: with_preview_schema.code.default %}
48
+ {%- assign preview_code_class = include.code_class | default: with_preview_schema.code_class.default %}
49
+
50
+ {%- comment %} === Presentation === {% endcomment %}
51
+
52
+ {%- comment %} --- Row visibility --- {% endcomment %}
53
+ {%- assign preview_show_code = false %}
54
+ {%- if preview_code != "" %}
55
+ {%- assign preview_show_code = true %}
56
+ {%- endif %}
57
+ {%- assign preview_show_toolbar = false %}
58
+ {%- if preview_language != "" or preview_show_code %}
59
+ {%- assign preview_show_toolbar = true %}
60
+ {%- endif %}
61
+ {%- assign preview_multirow = false %}
62
+ {%- if preview_show_toolbar %}
63
+ {%- assign preview_multirow = true %}
64
+ {%- endif %}
65
+
66
+ {%- comment %} --- Outer container: use the default multirow look, unless the caller set their own `class` --- {% endcomment %}
67
+ {%- if preview_multirow %}
68
+ {%- unless include.class %}
69
+ {%- assign preview_class = "mb-3 border rounded overflow-hidden" %}
70
+ {%- endunless %}
71
+ {%- endif %}
72
+
73
+ {%- comment %} --- Row 1: Live demo --- {% endcomment %}
74
+ {%- capture html_preview_content %}
75
+ {%- if preview_content != "" %}
76
+ <div class="preview-content{% if preview_content_class != "" %} {{ preview_content_class }}{% endif %}">
77
+ {{- preview_content -}}
78
+ </div>
79
+ {%- endif %}
80
+ {%- endcapture %}
81
+
82
+ {%- comment %} --- Row 2: Toolbar (language label + copy button) --- {% endcomment %}
83
+ {%- capture html_preview_toolbar %}
84
+ {%- if preview_show_toolbar %}
85
+ <div class="preview-toolbar m-0 p-2{% if preview_content != "" %} border-top{% endif %}{% if preview_show_code %} border-bottom{% endif %} border-centos-purple-100">
86
+ {%- if preview_language != "" %}<span class="preview-language{% if preview_language_class != "" %} {{ preview_language_class }}{% endif %}">{{ preview_language }}</span>{%- endif %}
87
+ <div class="preview-actions">
88
+ {%- if preview_show_code %}
89
+ <button type="button" class="copy-btn focus-ring preview-copy{% if preview_copy_class != "" %} {{ preview_copy_class }}{% endif %}" data-bs-toggle="tooltip" data-bs-title="Copy code" data-copy-value="{{ preview_code | escape }}" aria-label="Copy code">
90
+ <i class="fa-regular fa-copy"></i>
91
+ </button>
92
+ {%- endif %}
93
+ </div>
94
+ </div>
95
+ {%- endif %}
96
+ {%- endcapture %}
97
+
98
+ {%- comment %} --- Row 3: Code sample --- {% endcomment %}
99
+ {%- capture html_preview_code %}
100
+ {%- if preview_show_code %}
101
+ <div class="preview-code{% if preview_code_class != "" %} {{ preview_code_class }}{% endif %}">
102
+ <pre class="p-2"><code{% if preview_language != "" %} class="language-{{ preview_language }}"{% endif %}>{{ preview_code | escape }}</code></pre>
103
+ </div>
104
+ {%- endif %}
105
+ {%- endcapture %}
106
+
107
+ {%- comment %} --- HTML --- {% endcomment -%}
108
+ {%- if preview_multirow %}
109
+ <div class="preview {{ preview_class }}">
110
+ {{- html_preview_content | strip -}}
111
+ {{- html_preview_toolbar | strip -}}
112
+ {{- html_preview_code | strip -}}
113
+ </div>
114
+ {%- else %}
115
+ <div class="{{ preview_class }}">
116
+ {{- preview_content -}}
117
+ </div>
118
+ {%- endif %}
119
+ {%- comment %} trim trailing output {% endcomment -%}
@@ -130,7 +130,8 @@ body .ec .ec-button:not(:disabled):hover:not(.ec-active) {
130
130
  // the library's LTR/RTL mirroring transform, sized for the old glyph; our
131
131
  // `body .ec` prefix out-specifies its `[dir=rtl]` variant too. Coupled to
132
132
  // FontAwesome's default "css" mode and "Font Awesome 7 Free" family
133
- // (with_fontawesome_data.version default 7.0.1) — revisit if either changes.
133
+ // (see src/YAML/fontawesome_schema.yml for the current default version) —
134
+ // revisit if either changes.
134
135
  //
135
136
  // .ec-icon also needs resizing: the library sizes it at a fixed 1em for the
136
137
  // old 0.5em glyph. `1.25em` matches FontAwesome's default icon width;
@@ -9,18 +9,12 @@
9
9
  // CSS Custom Properties (currently unused)
10
10
  // ================================================================================
11
11
  // Not read anywhere — head.html.liquid computes its own scroll-offset values
12
- // inline from Liquid data instead, and the copy-button icon size below is
13
- // hardcoded rather than referencing --highlight-icon-width/height. Kept as a
14
- // record of the values those should stay in sync with.
12
+ // inline from Liquid data instead.
15
13
  :root {
16
14
  // Breaking News Component
17
15
  --breakingnews-alert-height: 31px;
18
16
  --navbar-height: 42px;
19
17
  --heading-margin-top: 48px;
20
-
21
- // Highlight.js Icon Sizing
22
- --highlight-icon-width: 24px;
23
- --highlight-icon-height: 24px;
24
18
  }
25
19
 
26
20
  body {
@@ -297,7 +291,17 @@ main {
297
291
  // Copy Value Component
298
292
  // --------------------------------------------------------------------------------
299
293
  .content {
294
+ // `.copy-btn` is a real <button>, so it gets native focus and
295
+ // Enter/Space activation. These rules restyle it as a plain icon
296
+ // trigger. Border, background, and padding reset separately below,
297
+ // scoped to skip `.input-group-text.copy-btn` (checksum and SRI-hash
298
+ // rows), which keeps Bootstrap's own addon box styling instead.
300
299
  .copy-btn {
300
+ appearance: none;
301
+ -webkit-appearance: none;
302
+ margin: 0;
303
+ font: inherit;
304
+ line-height: inherit;
301
305
  cursor: pointer;
302
306
  color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
303
307
  text-decoration: none;
@@ -307,62 +311,67 @@ main {
307
311
  }
308
312
  }
309
313
 
314
+ .copy-btn:not(.input-group-text) {
315
+ border: 0;
316
+ background: none;
317
+ padding: 0;
318
+ }
319
+
310
320
  .alert .copy-btn {
311
321
  color: var(--bs-alert-link-color);
312
322
  }
313
- }
314
323
 
315
- // --------------------------------------------------------------------------------
316
- // Highlightjs-copy
317
- // --------------------------------------------------------------------------------
318
- .content {
319
- code.hljs {
320
- border-radius: var(--bs-border-radius-lg);
324
+ // --------------------------------------------------------------------------------
325
+ // Inline code
326
+ // --------------------------------------------------------------------------------
327
+ // Bootstrap's inline `code` sets a text color ($code-color) but no
328
+ // background, so it barely stands out from surrounding text. This adds
329
+ // a muted background chip: padding, border-radius, and the same light
330
+ // background as the preview toolbar (_preview.scss's centos-purple-50);
331
+ // a darker shade reads as too strong next to body text.
332
+ //
333
+ // Code inside .preview-code is excluded — it's a block sample with its
334
+ // own background and padding already (_preview.scss).
335
+ code {
336
+ padding: 0.1em 0.4em;
337
+ background-color: var(--bs-centos-purple-50);
338
+ border-radius: var(--bs-border-radius);
321
339
  }
322
- pre {
323
- .hljs {
324
- max-height: 50vh;
325
- overflow: auto;
326
- }
327
- .hljs-copy-button {
328
- top: 0.2rem;
329
- right: 0.2rem;
330
- border-radius: var(--bs-border-radius-lg);
331
- }
332
340
 
333
- .hljs-copy-button:not([data-copied="true"])::before {
334
- mask-size: 100% 100%;
335
- }
336
-
337
- .hljs-copy-button[data-copied='true'] {
338
- color: transparent !important;
339
- font-size: 0 !important;
340
- text-indent: -9999px !important;
341
- width: 1.85rem !important; /* Set a fixed width for the button */
342
- height: 1.85rem !important; /* Set a fixed height for the button */
343
- position: relative !important; /* Required for absolute positioning of the SVG */
341
+ .preview-code code {
342
+ padding: 0;
343
+ background-color: transparent;
344
+ border-radius: 0;
345
+ }
344
346
 
345
- }
346
- .hljs-copy-button[data-copied='true']::after {
347
- content: "";
348
- background-repeat: no-repeat;
349
- background-size: contain;
350
- position: absolute;
351
- top: 50%;
352
- left: 50%;
353
- transform: translate(-50%, -50%);
354
- width: 1rem; /* Adjust icon size as needed */
355
- height: 1rem; /* Adjust icon size as needed */
356
- }
357
- code {
358
- border: 1px;
359
- border-color: var(--bs-light-border-subtle);
360
- border-style: solid;
361
- }
347
+ // A configuration default's long unbroken token (an SRI hash, a CDN
348
+ // URL, ...) has no natural break point, so it needs an explicit
349
+ // permission to wrap — otherwise it either overflows or forces its
350
+ // column wide (configuration_variables-default-cell.html.liquid, used
351
+ // by both configuration_variables.html.liquid and its nested
352
+ // counterpart). `anywhere` (not `break-word`) also lets it contribute
353
+ // a single-character min-content width, so table auto layout gives the
354
+ // column only the space it actually needs, regardless of how many
355
+ // columns the table has.
356
+ .long-value {
357
+ overflow-wrap: anywhere;
362
358
  }
363
359
  }
364
360
  }
365
361
 
362
+ // --------------------------------------------------------------------------------
363
+ // Focus Ring Utility
364
+ // --------------------------------------------------------------------------------
365
+ // Bootstrap's `.focus-ring` utility draws its ring on `:focus`, including
366
+ // mouse clicks. Every theme component that uses the class (copy buttons,
367
+ // links, card actions, navbar items, download buttons) needs the ring to
368
+ // show only on keyboard focus, so this single rule suppresses it whenever
369
+ // `:focus-visible` wouldn't otherwise match — instead of re-deriving
370
+ // `:focus-visible` behavior per component.
371
+ .focus-ring:focus:not(:focus-visible) {
372
+ box-shadow: none;
373
+ }
374
+
366
375
  // --------------------------------------------------------------------------------
367
376
  // Navbar-dependent scroll offset (fixed-top navbar only)
368
377
  // --------------------------------------------------------------------------------
@@ -0,0 +1,102 @@
1
+ // ================================================================================
2
+ // Highlight.js syntax colors
3
+ // ================================================================================
4
+ // Colors highlight.js's token classes with this site's CentOS palette,
5
+ // grouped by meaning — keyword, title, string, and so on — instead of
6
+ // Bootstrap's semantic roles. Every color meets WCAG AA contrast against
7
+ // the code background.
8
+ //
9
+ // Tag and attribute markup (HTML and XML structure) keeps the plain body
10
+ // text color, matching highlight.js's own default theme.
11
+ //
12
+ // The CentOS palette has no red. Removed diff lines use Bootstrap's
13
+ // danger color instead; added diff lines use CentOS green.
14
+ // ================================================================================
15
+
16
+ main {
17
+ .content {
18
+ .hljs {
19
+ color: var(--bs-body-color);
20
+ background: transparent;
21
+ }
22
+
23
+ .hljs-tag,
24
+ .hljs-punctuation,
25
+ .hljs-tag .hljs-name,
26
+ .hljs-tag .hljs-attr {
27
+ color: var(--bs-body-color);
28
+ }
29
+
30
+ // Keywords
31
+ .hljs-keyword,
32
+ .hljs-selector-tag,
33
+ .hljs-attribute,
34
+ .hljs-doctag,
35
+ .hljs-strong {
36
+ color: var(--bs-centos-purple-700);
37
+ font-weight: bold;
38
+ }
39
+
40
+ // Titles: function and class names being declared
41
+ .hljs-title,
42
+ .hljs-section,
43
+ .hljs-name {
44
+ color: var(--bs-centos-blue-500);
45
+ font-weight: bold;
46
+ }
47
+
48
+ // Strings
49
+ .hljs-string,
50
+ .hljs-template-tag,
51
+ .hljs-quote {
52
+ color: var(--bs-centos-green-800);
53
+ }
54
+
55
+ // Numbers, types, and meta (decorators, shebang lines)
56
+ .hljs-type,
57
+ .hljs-number,
58
+ .hljs-selector-id,
59
+ .hljs-selector-class,
60
+ .hljs-meta,
61
+ .hljs-meta .hljs-string {
62
+ color: var(--bs-centos-orange-800);
63
+ }
64
+
65
+ // Built-ins, literals, variables, operators, regexp
66
+ .hljs-built_in,
67
+ .hljs-bullet,
68
+ .hljs-code,
69
+ .hljs-literal,
70
+ .hljs-regexp,
71
+ .hljs-symbol,
72
+ .hljs-variable,
73
+ .hljs-template-variable,
74
+ .hljs-link,
75
+ .hljs-selector-attr,
76
+ .hljs-operator,
77
+ .hljs-selector-pseudo {
78
+ color: var(--bs-centos-purple-900);
79
+ }
80
+
81
+ // Removed diff lines
82
+ .hljs-deletion {
83
+ color: var(--bs-danger-text-emphasis);
84
+ background-color: var(--bs-danger-bg-subtle);
85
+ }
86
+
87
+ // Added diff lines
88
+ .hljs-addition {
89
+ color: var(--bs-centos-green-800);
90
+ background-color: var(--bs-centos-green-100);
91
+ }
92
+
93
+ // Comments — a lighter shade so they recede from the code around them
94
+ .hljs-comment {
95
+ color: var(--bs-centos-blue-400);
96
+ }
97
+
98
+ .hljs-emphasis {
99
+ font-style: italic;
100
+ }
101
+ }
102
+ }
@@ -0,0 +1,74 @@
1
+ // ================================================================================
2
+ // Preview component: demo, toolbar, and code row layout
3
+ // ================================================================================
4
+ // Styles the three-row layout preview.html.liquid can render: a live demo,
5
+ // a toolbar (language name and copy button), and a code sample. The rows
6
+ // sit flush against each other and the box, with no gaps or padding of
7
+ // their own. The plain, single-row layout (just `content`, no `language`
8
+ // or `code`) uses none of these classes, so none of these rules apply.
9
+ //
10
+ // The toolbar's own border classes live in preview.html.liquid and
11
+ // highlight.js instead of here, since the toolbar has no class to
12
+ // configure in the schema. Each border only shows on the side facing
13
+ // another row, so it never doubles up with the box's outer border.
14
+ //
15
+ // Every code block on the site — plain Markdown or built with the
16
+ // preview component — gets the same toolbar/code layout via highlight.js,
17
+ // and the same copy button, handled by copyvalue.js (loaded through
18
+ // copyvalue.html.liquid).
19
+ //
20
+ // Long code blocks are capped at 50vh with a scrollbar, so one long
21
+ // sample can't stretch the whole page.
22
+ // ================================================================================
23
+
24
+ .preview {
25
+ > .preview-content + .preview-toolbar,
26
+ > .preview-toolbar + .preview-code {
27
+ margin-top: $spacer * 0.75;
28
+ }
29
+
30
+ .preview-toolbar {
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ align-items: center;
34
+ gap: $spacer * 0.5;
35
+ // Same purple family as table headers (see _datatable.scss), one
36
+ // shade lighter.
37
+ background-color: var(--bs-centos-purple-50);
38
+ }
39
+
40
+ // margin-left: auto keeps the copy button pinned to the right edge even
41
+ // with no language label. justify-content: space-between would work too,
42
+ // but only when a label is present — with nothing beside the copy button,
43
+ // space-between has nothing to distribute space between, so the button
44
+ // would land on the left instead.
45
+ .preview-actions {
46
+ display: flex;
47
+ align-items: center;
48
+ gap: $spacer * 0.75;
49
+ margin-left: auto;
50
+ }
51
+
52
+ // Bootstrap adds a bottom margin to every <pre> by default; removed so
53
+ // the code sits flush against the row's bottom edge. Padding comes from
54
+ // a `p-2` class set on the <pre> in preview.html.liquid and highlight.js,
55
+ // not duplicated here.
56
+ .preview-code pre {
57
+ margin-bottom: 0;
58
+ background-color: #fcfcfc;
59
+ }
60
+
61
+ .preview-code code {
62
+ border: 0;
63
+ }
64
+
65
+ .preview-code .hljs {
66
+ // max-height/overflow have no effect on a non-replaced inline element
67
+ // (CSS2.1 §10.7); highlight.js's own stylesheet normally sets this
68
+ // block display, but this theme skips that file (see highlight.html.liquid)
69
+ // and only pulls colors from _highlight-theme.scss.
70
+ display: block;
71
+ max-height: 50vh;
72
+ overflow: auto;
73
+ }
74
+ }
@@ -26,14 +26,17 @@ $theme-colors: map-merge($theme-colors, $centos-base-colors);
26
26
  // Light shades: use standard tint-color (adds white, works well)
27
27
  $shade-color: tint-color($color, percentage(math.div(500 - $shade, 500)));
28
28
  } @else if $shade > 500 {
29
- // Special case: Green 700 needs 30% black mix (not 20%) for AA compliance.
30
- // This ensures WHITE text contrast meets 4.5:1 threshold.
29
+ // Special case: green-700 skips the saturated-shade formula below and
30
+ // mixes 30% black directly, to keep its contrast against this theme's
31
+ // body text at a safe margin above WCAG AA — see src/YAML/color.yml's
32
+ // generated centos-green-700 entry for the current contrast ratio.
31
33
  @if $name == "centos-green" and $shade == 700 {
32
34
  $shade-color: shade-color($color, 30%);
33
35
  } @else {
34
- // NEW: Use saturation-normalized shade for all other dark shades
35
- // This function increases saturation multiplier for grades 800-950
36
- // Result: vivid dark colors that feel on-brand
36
+ // Saturation-normalized shade for every other dark grade (800-950):
37
+ // increases the saturation multiplier so these stay vivid and
38
+ // on-brand instead of fading gray, the way Bootstrap's own
39
+ // shade-color() would.
37
40
  $shade-color: saturated-shade($color, $shade);
38
41
  }
39
42
  } @else {