Skip to content

Commit 65d7941

Browse files
committed
[IMP] runbot: add a friendly colorblindness theme
The runbot colors can lack contrast in some case, especially for colorblinded people. This commit introduces a theme that should help a little. Note that this was done without much analysis and should be tweaked in the future.
1 parent 9d62213 commit 65d7941

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

runbot/static/src/css/runbot.css

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
--bs-info-bg-subtle: #d9edf7;
1414
--bs-info-rgb: 23, 162, 184;
1515
}
16+
:root[data-bs-theme=red404] {
17+
--bs-success-bg-subtle: #cdffb9;
18+
--bs-danger-bg-subtle: #e67ecf;
19+
--bs-warning-bg-subtle: #fae9b1;
20+
--bs-info-bg-subtle: #b6e2f8;
21+
--bs-info-rgb: 23, 162, 184;
22+
}
1623

1724
[data-bs-theme=legacy] .text-bg-info {
1825
color: #fff !important; /* black by default, changes from previous version, color forced to fit with --bs-info-rgb*/
1926
}
2027

21-
22-
2328
[data-bs-theme=legacy] .btn-success {
2429
--bs-btn-color: #fff;
2530
--bs-btn-bg: #198754;
@@ -37,6 +42,23 @@
3742
--bs-btn-disabled-border-color: #28a745;
3843
}
3944

45+
[data-bs-theme=red404] .btn-danger {
46+
--bs-btn-color: #fff;
47+
--bs-btn-bg: #990a59;
48+
--bs-btn-border-color: #990a59;
49+
--bs-btn-hover-color: #fff;
50+
--bs-btn-hover-bg: #740442;
51+
--bs-btn-hover-border-color: #740442;
52+
--bs-btn-focus-shadow-rgb: 60, 153, 110;
53+
--bs-btn-active-color: #fff;
54+
--bs-btn-active-bg: #740442;
55+
--bs-btn-active-border-color: #740442;
56+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
57+
--bs-btn-disabled-color: #fff;
58+
--bs-btn-disabled-bg: #b90e6c;
59+
--bs-btn-disabled-border-color: #b90e6c;
60+
}
61+
4062

4163
:root {
4264
--alternative:#ccc;

runbot/templates/utils.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
<t t-if="not user_id._is_public()">
6161
<t t-call="runbot.build_errors_link"/>
6262
<li class="nav-item dropdown" t-ignore="true">
63-
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
64-
<b>
65-
<span t-esc="user_id.name[:23] + '...' if user_id.name and len(user_id.name) &gt; 25 else user_id.name"/>
63+
<a href="#" clzepplint-esc="user_id.name[:23] + '...' if user_id.name and len(user_id.name) &gt; 25 else user_id.name"/>
6664
</b>
6765
</a>
6866
<div class="dropdown-menu js_usermenu" role="menu">
@@ -104,6 +102,7 @@
104102
<button onclick="document.cookie = 'theme=legacy; expires=Thu, 1 Dec 2942 12:00:00 UTC; path=/'; location.reload();" type="button" t-attf-class="btn btn-{{'primary' if theme=='legacy' else 'secondary'}}">Legacy</button>
105103
<button onclick="document.cookie = 'theme=dark; expires=Thu, 1 Dec 2942 12:00:00 UTC; path=/'; location.reload();" type="button" t-attf-class="btn btn-{{'primary' if theme=='dark' else 'secondary'}}">Dark</button>
106104
<button onclick="document.cookie = 'theme=light; expires=Thu, 1 Dec 2942 12:00:00 UTC; path=/'; location.reload();" type="button" t-attf-class="btn btn-{{'primary' if theme=='light' else 'secondary'}}">Light</button>
105+
<button onclick="document.cookie = 'theme=red404; expires=Thu, 1 Dec 2942 12:00:00 UTC; path=/'; location.reload();" type="button" t-attf-class="btn btn-{{'primary' if theme=='red404' else 'secondary'}}">Red404</button>
107106
</div>
108107

109108
<hr class="separator"/>

0 commit comments

Comments
 (0)