Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/controllers/maintenance_tasks/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ class ApplicationController < MaintenanceTasks.parent_controller.constantize
BULMA_CDN = "https://cdn.jsdelivr.net"

content_security_policy do |policy|
policy.style_src(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary? We changed from style_src -> style_src_elem in #1195 to prevent CSP conflicts when the parent application uses style_src_elem directives, since we fall back to style_src.

:self,
BULMA_CDN,
)
policy.style_src_elem(
BULMA_CDN,
# <style> tag in app/views/layouts/maintenance_tasks/application.html.erb
"'sha256-WHHDQLdkleXnAN5zs0GDXC5ls41CHUaVsJtVpaNx+EM='",
"'sha256-LVai3C2/+O9MPVaeiRrXbcSwDbPxqWfXI4pz487d9Js='",
)
capybara_lockstep_scripts = [
"'sha256-1AoN3ZtJC5OvqkMgrYvhZjp4kI8QjJjO7TAyKYiDw+U='",
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/maintenance_tasks/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="navbar is-light" role="navigation" aria-label="main navigation">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<%= link_to 'Maintenance Tasks', root_path, class: 'navbar-item is-size-4 has-text-weight-semibold has-text-danger' %>
</div>
Expand Down
51 changes: 41 additions & 10 deletions app/views/layouts/maintenance_tasks/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,44 @@
<%= csrf_meta_tags %>

<%=
stylesheet_link_tag(URI.join(controller.class::BULMA_CDN, "npm/[email protected]/css/versions/bulma-no-dark-mode.min.css"),
stylesheet_link_tag(URI.join(controller.class::BULMA_CDN, "npm/[email protected]/css/bulma.min.css"),
media: :all,
integrity: "sha256-HCNMQcqH/4MnGR0EYg2S3/BXYMM1z9lrFV10ANRd79o",
integrity: "sha256-RwYNyYLkMTjyYn8FRzVzQFtHXuHg9dpfkPCuf6j2XDM=",
crossorigin: "anonymous") unless request.xhr?
%>

<style>
.ruby-comment { color: #6a737d;}
.ruby-const { color: #e36209; }
.ruby-embexpr-beg, .ruby-embexpr-end, .ruby-period { color: #24292e; }
.ruby-ident, .ruby-symbeg { color: #6f42c1; }
.ruby-ivar, .ruby-cvar, .ruby-gvar, .ruby-int, .ruby-imaginary, .ruby-float, .ruby-rational { color: #005cc5; }
.ruby-kw { color: #d73a49; }
.ruby-label, .ruby-tstring-beg, .ruby-tstring-content, .ruby-tstring-end { color: #032f62; }
:root {
--ruby-comment: #6a737d;
--ruby-const: #e36209;
--ruby-embexpr: #24292e;
--ruby-ident: #6f42c1;
--ruby-number: #005cc5;
--ruby-keyword: #d73a49;
--ruby-string: #032f62;
--required-color: #ff6685;
}

@media (prefers-color-scheme: dark) {
:root {
--ruby-comment: #8b949e;
--ruby-const: #ffa657;
--ruby-embexpr: #c9d1d9;
--ruby-ident: #d2a8ff;
--ruby-number: #79c0ff;
--ruby-keyword: #ff7b72;
--ruby-string: #a5d6ff;
--required-color: #ff6685;
}
}

.ruby-comment { color: var(--ruby-comment); }
.ruby-const { color: var(--ruby-const); }
.ruby-embexpr-beg, .ruby-embexpr-end, .ruby-period { color: var(--ruby-embexpr); }
.ruby-ident, .ruby-symbeg { color: var(--ruby-ident); }
.ruby-ivar, .ruby-cvar, .ruby-gvar, .ruby-int, .ruby-imaginary, .ruby-float, .ruby-rational { color: var(--ruby-number); }
.ruby-kw { color: var(--ruby-keyword); }
.ruby-label, .ruby-tstring-beg, .ruby-tstring-content, .ruby-tstring-end { color: var(--ruby-string); }

.select, select { width: 100%; }
summary { cursor: pointer; }
Expand All @@ -55,9 +79,16 @@
box-shadow: 0 4px 6px -1px #0000001a,
0 2px 4px -2px #0000001a;
}

@media (prefers-color-scheme: dark) {
.box {
background-color: var(--bulma-scheme-main-bis);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could potentially go lighter here for the boxes.

--bulma-scheme-main-bis
Image

--bulma-background (a bit lighter)
Image

}
}

.label.is-required:after {
content: " (required)";
color: #ff6685;
color: var(--required-color);
font-size: 12px;
}
</style>
Expand Down