Skip to content

Commit 5dcb156

Browse files
committed
[TASK] New styling for version directives
1 parent d04a472 commit 5dcb156

File tree

5 files changed

+103
-44
lines changed

5 files changed

+103
-44
lines changed

packages/typo3-docs-theme/assets/sass/_component_rst.scss

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,7 @@
3333
// margin: 0;
3434
//}
3535

36-
/**
37-
* Version Added, Changed, Deprecated
38-
*/
39-
div {
40-
.deprecated,
41-
.versionadded,
42-
.versionchanged {
43-
border-left: 2px solid hsl(26.5, 84.3%, 85%);
44-
padding-left: 1em;
45-
}
46-
}
4736

48-
/**
49-
* Version Modified
50-
*/
51-
.versionmodified {
52-
background-color: hsl(26.5, 84.3%, 95%);
53-
border-radius: 3px;
54-
border: 1px solid hsl(26.5, 84.3%, 85%);
55-
color: $code-color-typoscript;
56-
font-style: italic;
57-
margin: 0 3px 0 0;
58-
padding: 0 2px;
59-
}
6037

6138
/**
6239
* Images and objects
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@mixin version-changed($border-color: $info, $icon-color: darken($border-color, 15%), $background-color: lighten($border-color, 40%), $text-color: color-contrast($background-color)) {
2+
border-left: 5px solid $border-color;
3+
padding-left: 1em;
4+
.versionmodified {
5+
.versionicon {
6+
color: $icon-color;
7+
padding-right: .5em;
8+
}
9+
color: $text-color;
10+
font-weight: bold;
11+
margin-bottom: 0.5em;
12+
padding: 0 2px;
13+
}
14+
}
15+
/**
16+
* Version Added, Changed, Deprecated
17+
*/
18+
.deprecated {
19+
@include version-changed($gray-700);
20+
}
21+
.versionadded {
22+
@include version-changed($success);
23+
}
24+
.versionchanged {
25+
@include version-changed($info);
26+
}
27+
28+
.admonition {
29+
.deprecated, .versionadded, .versionchanged {
30+
border: none;
31+
padding: 0;
32+
}
33+
}

packages/typo3-docs-theme/assets/sass/theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
@import 'component_confval.scss';
4545
@import 'component_fieldlist';
4646
@import 'component_textroles';
47+
@import 'component_versionchanged';
4748

4849
// misc
4950
@import 'utilities';

packages/typo3-docs-theme/resources/public/css/theme.css

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24625,12 +24625,6 @@ a.toc-title-project:hover {
2462524625
/**
2462624626
* Lists
2462724627
*/
24628-
/**
24629-
* Version Added, Changed, Deprecated
24630-
*/
24631-
/**
24632-
* Version Modified
24633-
*/
2463424628
/**
2463524629
* Images and objects
2463624630
*/
@@ -24668,21 +24662,6 @@ a.toc-title-project:hover {
2466824662
margin: 0;
2466924663
}
2467024664
}
24671-
.rst-content div .deprecated,
24672-
.rst-content div .versionadded,
24673-
.rst-content div .versionchanged {
24674-
border-left: 2px solid hsl(26.5, 84.3%, 85%);
24675-
padding-left: 1em;
24676-
}
24677-
.rst-content .versionmodified {
24678-
background-color: hsl(26.5, 84.3%, 95%);
24679-
border-radius: 3px;
24680-
border: 1px solid hsl(26.5, 84.3%, 85%);
24681-
color: hsl(12, 100%, 20%);
24682-
font-style: italic;
24683-
margin: 0 3px 0 0;
24684-
padding: 0 2px;
24685-
}
2468624665
.rst-content img,
2468724666
.rst-content object {
2468824667
display: inline-block;
@@ -25086,6 +25065,59 @@ kbd {
2508625065
border: 1px solid #319fc0;
2508725066
}
2508825067

25068+
/**
25069+
* Version Added, Changed, Deprecated
25070+
*/
25071+
.deprecated {
25072+
border-left: 5px solid gray;
25073+
padding-left: 1em;
25074+
}
25075+
.deprecated .versionmodified {
25076+
color: #000000;
25077+
font-weight: bold;
25078+
margin-bottom: 0.5em;
25079+
padding: 0 2px;
25080+
}
25081+
.deprecated .versionmodified .versionicon {
25082+
color: #5a5a5a;
25083+
padding-right: 0.5em;
25084+
}
25085+
25086+
.versionadded {
25087+
border-left: 5px solid #5cb85c;
25088+
padding-left: 1em;
25089+
}
25090+
.versionadded .versionmodified {
25091+
color: #000000;
25092+
font-weight: bold;
25093+
margin-bottom: 0.5em;
25094+
padding: 0 2px;
25095+
}
25096+
.versionadded .versionmodified .versionicon {
25097+
color: #3d8b3d;
25098+
padding-right: 0.5em;
25099+
}
25100+
25101+
.versionchanged {
25102+
border-left: 5px solid #319fc0;
25103+
padding-left: 1em;
25104+
}
25105+
.versionchanged .versionmodified {
25106+
color: #000000;
25107+
font-weight: bold;
25108+
margin-bottom: 0.5em;
25109+
padding: 0 2px;
25110+
}
25111+
.versionchanged .versionmodified .versionicon {
25112+
color: #216d83;
25113+
padding-right: 0.5em;
25114+
}
25115+
25116+
.admonition .deprecated, .admonition .versionadded, .admonition .versionchanged {
25117+
border: none;
25118+
padding: 0;
25119+
}
25120+
2508925121
.no-focus {
2509025122
outline: none !important;
2509125123
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<div class="versionchange {{ node.type }}">
2+
<p class="versionmodified">
3+
<span class="versionicon">
4+
{%- if node.type=="deprecated" -%}
5+
<i class="fa-solid fa-ban"></i>
6+
{%- elseif node.type=="versionadded" -%}
7+
<i class="fa-solid fa-rocket"></i>
8+
{%- elseif node.type=="versionchanged" -%}
9+
<i class="fa-solid fa-arrows-rotate"></i>
10+
{%- endif -%}
11+
</span>
12+
{{ node.versionLabel }}</p>
13+
<article>
14+
{{ renderNode(node.value) }}
15+
</article>
16+
</div>

0 commit comments

Comments
 (0)