Skip to content

Commit f8ec6c2

Browse files
authored
Add color contrast (#309)
2 parents 209b10a + 6ec11c3 commit f8ec6c2

4 files changed

Lines changed: 51 additions & 6 deletions

File tree

build_dita2html5-bootstrap_template.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@
2121
value="${dita.plugin.org.dita-bootstrap.html.dir}/css/"
2222
/>
2323

24+
<!-- Add DITA colors with bootswatch overrides as necessary -->
25+
26+
<condition
27+
property="dita-bootstrap.bootswatch.css.file"
28+
value="${dita-bootstrap.css.dir}/bootswatch-static.css"
29+
>
30+
<or>
31+
<equals arg1="${bootstrap.theme}" arg2="cyborg"/>
32+
<equals arg1="${bootstrap.theme}" arg2="darkly"/>
33+
<equals arg1="${bootstrap.theme}" arg2="slate"/>
34+
<equals arg1="${bootstrap.theme}" arg2="solar"/>
35+
<equals arg1="${bootstrap.theme}" arg2="vapor"/>
36+
</or>
37+
</condition>
38+
<property
39+
name="dita-bootstrap.bootswatch.css.file"
40+
value="${dita-bootstrap.css.dir}/bootswatch-colors.css"
41+
/>
42+
43+
<loadfile
44+
property="dita-bootstrap.bootswatch.css"
45+
srcFile="${dita-bootstrap.bootswatch.css.file}"
46+
/>
47+
<echo
48+
append="true"
49+
message="${line.separator}${dita-bootstrap.bootswatch.css}"
50+
if:set="dita-bootstrap.css.add"
51+
file="${extend.css.file}"
52+
/>
53+
54+
2455
<!-- Add Common CSS where Bootstrap variables override DITA-OT defaults -->
2556
<loadfile
2657
property="dita-bootstrap.css"

css/bootswatch-colors.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*!
2+
* This file is part of the DITA Bootstrap plug-in for DITA Open Toolkit.
3+
* See the accompanying LICENSE file for applicable licenses.
4+
*/
5+
6+
:root {
7+
--dita-prussian-blue: var(--bs-primary-text-emphasis);
8+
--dita-maroon: var(--bs-danger-text-emphasis);
9+
--dita-violet: var(--bs-purple);
10+
}

css/bootswatch-static.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*!
2+
* This file is part of the DITA Bootstrap plug-in for DITA Open Toolkit.
3+
* See the accompanying LICENSE file for applicable licenses.
4+
*/
5+
6+
:root {
7+
--dita-prussian-blue: #6a91cf;
8+
--dita-violet: #cc99cd;
9+
--dita-maroon: #ff7676;
10+
}

css/common-bootstrap.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
* See the accompanying LICENSE file for applicable licenses.
44
*/
55

6-
:root {
7-
--dita-prussian-blue: var(--bs-primary-text-emphasis);
8-
--dita-maroon: var(--bs-danger-text-emphasis);
9-
--dita-violet: var(--bs-purple);
10-
}
11-
126
.list-group-item.active,
137
.nav-link.active,
148
[data-bs-theme='dark'] {

0 commit comments

Comments
 (0)