jekyll-theme-centos 2.52.0.beta.101 → 2.52.0.beta.103
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 +4 -4
- data/_config.yml +2 -2
- data/_data/base/backtotop_schema.yml +6 -4
- data/_data/base/card_schema.yml +2 -2
- data/_data/base/copyright_schema.yml +1 -1
- data/_data/base/heading_anchor.yml +1 -1
- data/_data/base/heading_anchor_schema.yml +1 -1
- data/_data/base/highlight_schema.yml +1433 -60
- data/_data/base/link_schema.yml +1 -1
- data/_data/base/preview_schema.yml +88 -0
- data/_includes/base/color-table.html.liquid +4 -4
- data/_includes/base/configuration_variables-nested.html.liquid +29 -8
- data/_includes/base/copyvalue.html.liquid +23 -17
- data/_includes/base/download_architecture.html.liquid +13 -11
- data/_includes/base/download_documentation.html.liquid +1 -1
- data/_includes/base/download_filevalue.html.liquid +1 -1
- data/_includes/base/footer.html.liquid +1 -1
- data/_includes/base/head.html.liquid +8 -9
- data/_includes/base/highlight.html.liquid +40 -50
- data/_includes/base/navbar.html.liquid +4 -4
- data/_includes/base/preview.html.liquid +119 -0
- data/_sass/base/_calendar.scss +2 -1
- data/_sass/base/_customization.scss +49 -53
- data/_sass/base/_highlight-theme.scss +102 -0
- data/_sass/base/_preview.scss +74 -0
- data/_sass/base/_variables.scss +54 -73
- data/assets/css/base/stylesheet.min.scss +3 -1
- data/assets/js/base/backtotop.js +2 -2
- data/assets/js/base/copyvalue.js +3 -0
- data/assets/js/base/datatable.js +15 -9
- data/assets/js/base/highlight.js +86 -12
- metadata +5 -1
|
@@ -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 -%}
|
data/_sass/base/_calendar.scss
CHANGED
|
@@ -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
|
-
// (
|
|
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
|
|
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,54 @@ 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
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
-
|
|
334
|
-
|
|
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 */
|
|
344
|
-
|
|
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
|
-
}
|
|
341
|
+
.preview-code code {
|
|
342
|
+
padding: 0;
|
|
343
|
+
background-color: transparent;
|
|
344
|
+
border-radius: 0;
|
|
362
345
|
}
|
|
363
346
|
}
|
|
364
347
|
}
|
|
365
348
|
|
|
349
|
+
// --------------------------------------------------------------------------------
|
|
350
|
+
// Focus Ring Utility
|
|
351
|
+
// --------------------------------------------------------------------------------
|
|
352
|
+
// Bootstrap's `.focus-ring` utility draws its ring on `:focus`, including
|
|
353
|
+
// mouse clicks. Every theme component that uses the class (copy buttons,
|
|
354
|
+
// links, card actions, navbar items, download buttons) needs the ring to
|
|
355
|
+
// show only on keyboard focus, so this single rule suppresses it whenever
|
|
356
|
+
// `:focus-visible` wouldn't otherwise match — instead of re-deriving
|
|
357
|
+
// `:focus-visible` behavior per component.
|
|
358
|
+
.focus-ring:focus:not(:focus-visible) {
|
|
359
|
+
box-shadow: none;
|
|
360
|
+
}
|
|
361
|
+
|
|
366
362
|
// --------------------------------------------------------------------------------
|
|
367
363
|
// Navbar-dependent scroll offset (fixed-top navbar only)
|
|
368
364
|
// --------------------------------------------------------------------------------
|
|
@@ -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
|
+
}
|
data/_sass/base/_variables.scss
CHANGED
|
@@ -20,39 +20,36 @@
|
|
|
20
20
|
// ────────────────────────────────────────────────────────────────────────────
|
|
21
21
|
// Function: Get saturation multiplier for a given shade grade
|
|
22
22
|
// ────────────────────────────────────────────────────────────────────────────
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// Using 2.0x multiplier to reach 100% from base ~50% saturation
|
|
23
|
+
// Light shades (50-400) get less saturated for a softer look on a light
|
|
24
|
+
// background; dark shades (800-950) get more, to counter the desaturation
|
|
25
|
+
// Bootstrap's own algorithm would otherwise produce. The 950 multiplier
|
|
26
|
+
// (2.0x) pushes toward the wallpaper's 100% saturation, but only reaches it
|
|
27
|
+
// for a base color already at 50%+ saturation — see saturated-shade() below
|
|
28
|
+
// for how this plays out for each CentOS color.
|
|
30
29
|
@function saturation-multiplier($shade) {
|
|
31
30
|
@if $shade <= 400 {
|
|
32
|
-
@return 0.6;
|
|
31
|
+
@return 0.6;
|
|
33
32
|
} @else if $shade == 500 {
|
|
34
|
-
@return 1.0;
|
|
33
|
+
@return 1.0;
|
|
35
34
|
} @else if $shade == 600 {
|
|
36
|
-
@return 1.0;
|
|
35
|
+
@return 1.0;
|
|
37
36
|
} @else if $shade == 700 {
|
|
38
|
-
@return 1.0;
|
|
37
|
+
@return 1.0;
|
|
39
38
|
} @else if $shade == 800 {
|
|
40
|
-
@return 1.1;
|
|
39
|
+
@return 1.1;
|
|
41
40
|
} @else if $shade == 900 {
|
|
42
|
-
@return 1.8;
|
|
41
|
+
@return 1.8;
|
|
43
42
|
} @else if $shade == 950 {
|
|
44
|
-
@return 2.0;
|
|
43
|
+
@return 2.0;
|
|
45
44
|
} @else {
|
|
46
|
-
@return 1.0;
|
|
45
|
+
@return 1.0;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
// ────────────────────────────────────────────────────────────────────────────
|
|
51
50
|
// Function: Calculate target lightness for a shade grade
|
|
52
51
|
// ────────────────────────────────────────────────────────────────────────────
|
|
53
|
-
//
|
|
54
|
-
// Creates smooth interpolation from light to dark
|
|
55
|
-
// Option 2: Target 8% lightness for grade 950 (matches wallpaper ~16% brightness)
|
|
52
|
+
// Interpolates lightness smoothly from light (grade 50) to dark (grade 950).
|
|
56
53
|
@function target-lightness($shade, $base-lightness) {
|
|
57
54
|
@if $shade < 500 {
|
|
58
55
|
// Light shades: interpolate from 95% (very light) down to base lightness
|
|
@@ -67,8 +64,7 @@
|
|
|
67
64
|
// Grade 900: transition toward wallpaper lightness
|
|
68
65
|
@return $base-lightness - math.div(900 - 500, 500) * ($base-lightness - 10%);
|
|
69
66
|
} @else if $shade == 950 {
|
|
70
|
-
//
|
|
71
|
-
// All grade-950 colors use 8% lightness to match wallpaper depth
|
|
67
|
+
// Every color's grade-950 targets the wallpaper's 8% lightness.
|
|
72
68
|
@return 8%;
|
|
73
69
|
} @else {
|
|
74
70
|
// Default fallback
|
|
@@ -77,29 +73,21 @@
|
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
// ────────────────────────────────────────────────────────────────────────────
|
|
80
|
-
// Function: Generate saturation-normalized shade
|
|
76
|
+
// Function: Generate a saturation-normalized shade
|
|
81
77
|
// ────────────────────────────────────────────────────────────────────────────
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
78
|
+
// Extracts HSL from the base color, applies the multipliers above, and
|
|
79
|
+
// returns the shade as HSL. Kept as a function rather than hardcoded shades
|
|
80
|
+
// so every color family follows the same rule and stays internally
|
|
81
|
+
// consistent if a base color ever changes.
|
|
82
|
+
//
|
|
83
|
+
// Grade 950 targets the wallpaper's saturation and lightness (see the top
|
|
84
|
+
// of this file), but only reaches it for a base color already saturated
|
|
85
|
+
// enough for the 2.0x multiplier to hit 100% — orange, blue, and green all
|
|
86
|
+
// do. Purple's base saturation is too low, so purple-950 lands close to the
|
|
87
|
+
// wallpaper's dark corner rather than matching it exactly; see
|
|
88
|
+
// src/YAML/color.yml or the generated src/SASS/_light-dark.scss for its
|
|
89
|
+
// actual current value.
|
|
85
90
|
@function saturated-shade($color, $shade) {
|
|
86
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
87
|
-
// Function: Generate saturation-normalized shade with wallpaper alignment
|
|
88
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
89
|
-
// Design Principle: Grade-950 colors maintain native hues while achieving
|
|
90
|
-
// wallpaper aesthetic through shared saturation (100%) and lightness (~8%)
|
|
91
|
-
//
|
|
92
|
-
// Wallpaper Reference: #1A0029 (100% saturation, 8% lightness)
|
|
93
|
-
// Grade-950 Alignment: All colors achieve 100% saturation + 8% lightness
|
|
94
|
-
// Result: UI colors share wallpaper depth while maintaining brand identity
|
|
95
|
-
//
|
|
96
|
-
// Why function-based instead of hardcoded?
|
|
97
|
-
// - Maintains hue consistency within each color family
|
|
98
|
-
// - Preserves algorithmic cohesion across all 4 color families
|
|
99
|
-
// - Achieves wallpaper correlation through saturation/brightness alignment
|
|
100
|
-
// - Creates unified visual language respecting color family rules
|
|
101
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
102
|
-
|
|
103
91
|
// Extract current HSL values from the color
|
|
104
92
|
$current-hue: hue($color);
|
|
105
93
|
$current-saturation: saturation($color);
|
|
@@ -128,38 +116,25 @@ $centos-base-colors: (
|
|
|
128
116
|
$centos-color-shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950;
|
|
129
117
|
|
|
130
118
|
// --------------------------------------------------------------------------------
|
|
131
|
-
// Theme
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
// outcomes. Brand colors remain from official CentOS specification.
|
|
139
|
-
//
|
|
140
|
-
// Color Theory Rationale:
|
|
141
|
-
// - Orange = Caution/Warning (warm, attention-getting, ISO standard)
|
|
142
|
-
// - Blue = Information (cool, trustworthy, ISO standard)
|
|
143
|
-
// - Red = Danger (alert, critical, ISO standard)
|
|
144
|
-
// - Green = Success (positive, safe, ISO standard)
|
|
145
|
-
// - Purple = Brand primary (custom, strong visual identity)
|
|
146
|
-
//
|
|
147
|
-
// Mapping:
|
|
148
|
-
// - Primary: centos-purple #A54C93 (brand primary - balanced for visual prominence)
|
|
149
|
-
// - Secondary: centos-orange #B27800 (brand secondary - balanced for color harmony)
|
|
150
|
-
// - Success: centos-green #4A8400 darkened (positive outcomes, from #84B800)
|
|
151
|
-
// - Warning: centos-orange #C86A00 darkened (caution/attention, warm tone - correct psychology)
|
|
152
|
-
// - Danger: External red #C62828 (critical/destructive - no CentOS equivalent)
|
|
153
|
-
// - Info: External blue #1976D2 (informational - distinguishes from warning)
|
|
119
|
+
// Theme colors
|
|
120
|
+
// --------------------------------------------------------------------------------
|
|
121
|
+
// Primary and secondary come straight from the CentOS brand palette. Success
|
|
122
|
+
// and warning are darkened centos-green/centos-orange, keeping them on-brand
|
|
123
|
+
// while following the ISO 3864 color meanings (green = success, orange =
|
|
124
|
+
// caution). Danger and info have no CentOS equivalent, so they use ISO
|
|
125
|
+
// 3864's own red and blue instead.
|
|
154
126
|
//
|
|
155
|
-
//
|
|
127
|
+
// All four are WCAG AA verified against both white and black text. After
|
|
128
|
+
// changing one, re-check with:
|
|
129
|
+
// python3 scripts/colors/tools/calculate-contrast.py "#FFFFFF" "<hex>"
|
|
130
|
+
// See color.md for the full contrast and color-psychology write-up.
|
|
156
131
|
// --------------------------------------------------------------------------------
|
|
157
132
|
$primary: map-get($centos-base-colors, 'centos-purple');
|
|
158
|
-
$secondary: map-get($centos-base-colors, 'centos-orange'); //
|
|
159
|
-
$success: #4A8400; // Darkened centos-green
|
|
160
|
-
$warning: #C86A00; // Darkened centos-orange
|
|
161
|
-
$danger: #C62828; // External red
|
|
162
|
-
$info: #1976D2; // External blue
|
|
133
|
+
$secondary: map-get($centos-base-colors, 'centos-orange'); // CentOS brand secondary
|
|
134
|
+
$success: #4A8400; // Darkened centos-green
|
|
135
|
+
$warning: #C86A00; // Darkened centos-orange - warm, urgent
|
|
136
|
+
$danger: #C62828; // External red - no CentOS equivalent
|
|
137
|
+
$info: #1976D2; // External blue - distinguishes from warning
|
|
163
138
|
|
|
164
139
|
// Light and dark are automatically generated from centos-purple using the saturation-normalized
|
|
165
140
|
// shade system. Instead of assigning function results to variables here (which causes Dart Sass
|
|
@@ -174,10 +149,16 @@ $info: #1976D2; // External blue: 4.60:1 (white), 4.56:1 (black) - WCAG AA
|
|
|
174
149
|
$white: #ffffff;
|
|
175
150
|
$black: #000000;
|
|
176
151
|
|
|
152
|
+
// Bootstrap's default inline-code color isn't part of this site's brand
|
|
153
|
+
// and fails WCAG AA against the code background in _customization.scss.
|
|
154
|
+
// This is centos-purple-700.
|
|
155
|
+
$code-color: #673259;
|
|
156
|
+
|
|
177
157
|
// Background and Body variables
|
|
178
158
|
// These control the default background and text colors for the entire page.
|
|
179
159
|
$body-bg: $white;
|
|
180
|
-
$body-color: #1c0d19; //
|
|
160
|
+
$body-color: #1c0d19; // purple-tinted near-black; matches the text_color_hex value
|
|
161
|
+
// used across most centos-purple shades in _data/base/color.yml
|
|
181
162
|
|
|
182
163
|
// Bootstrap's color-contrast() function (used by .text-bg-* utilities like
|
|
183
164
|
// .text-bg-light) picks between $color-contrast-dark/-light to pair with a
|
|
@@ -188,8 +169,8 @@ $color-contrast-dark: $body-color;
|
|
|
188
169
|
|
|
189
170
|
// Border and Emphasis colors
|
|
190
171
|
// Used for borders, dividers, and higher-contrast text.
|
|
191
|
-
$border-color: #e8d9e5; //
|
|
192
|
-
$emphasis-color: #d1b3cb; //
|
|
172
|
+
$border-color: #e8d9e5; // light purple-family tint, for borders and dividers
|
|
173
|
+
$emphasis-color: #d1b3cb; // light purple-family tint, higher-contrast than $border-color
|
|
193
174
|
|
|
194
175
|
// Dropdown menu
|
|
195
176
|
$dropdown-dark-bg: $dark;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
5
|
* CentOS Customization
|
|
6
|
-
* Copyright
|
|
6
|
+
* Copyright (c) 2026 Alain Reguera Delgado
|
|
7
7
|
* Licensed under MIT License (https://opensource.org/licenses/MIT)
|
|
8
8
|
*
|
|
9
9
|
* Customized CSS extensions for the CentOS project built on top of Bootstrap.
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
// 6. Add additional custom code here
|
|
43
43
|
@import "base/customization";
|
|
44
44
|
@import "base/download";
|
|
45
|
+
@import "base/preview";
|
|
46
|
+
@import "base/highlight-theme";
|
|
45
47
|
|
|
46
48
|
// 7. Third-party component theme overrides (must load after our own
|
|
47
49
|
// customizations so component-specific corrections win the cascade).
|