Commit 2ca202df authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'tz-activate-startupcss' into 'master'

Activate Startup.CSS

See merge request gitlab-org/gitlab!39713
parents 36fc17c3 a38699e0
...@@ -236,7 +236,7 @@ module ApplicationHelper ...@@ -236,7 +236,7 @@ module ApplicationHelper
end end
def use_startup_css? def use_startup_css?
params[:startup_css] == 'true' || cookies['startup_css'] == 'true' Feature.enabled?(:startup_css) && !Rails.env.test?
end end
def stylesheet_link_tag_defer(path) def stylesheet_link_tag_defer(path)
......
...@@ -49,9 +49,7 @@ ...@@ -49,9 +49,7 @@
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png' = favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
- if use_startup_css? = render 'layouts/startup_css'
%style{ type: "text/css" }
= Rails.application.assets_manifest.find_sources('startup/startup-general.css').first.to_s.html_safe
- if user_application_theme == 'gl-dark' - if user_application_theme == 'gl-dark'
= stylesheet_link_tag_defer "application_dark" = stylesheet_link_tag_defer "application_dark"
- else - else
...@@ -61,7 +59,7 @@ ...@@ -61,7 +59,7 @@
= stylesheet_link_tag_defer "highlight/themes/#{user_color_scheme}" = stylesheet_link_tag_defer "highlight/themes/#{user_color_scheme}"
= render 'layouts/startup_css' = render 'layouts/startup_css_activation'
= Gon::Base.render_data(nonce: content_security_policy_nonce) = Gon::Base.render_data(nonce: content_security_policy_nonce)
......
- return unless use_startup_css? - return unless use_startup_css?
= javascript_tag nonce: true do %style{ type: "text/css" }
:plain = Rails.application.assets_manifest.find_sources('startup/startup-general.css').first.to_s.html_safe
document.querySelectorAll('link[media="print"]').forEach(linkTag => {
linkTag.addEventListener('load', function() {this.media='all'}, {once: true});
})
- return unless use_startup_css?
= javascript_tag nonce: true do
:plain
document.querySelectorAll('link[media="print"]').forEach(linkTag => {
linkTag.addEventListener('load', function() {this.media='all'}, {once: true});
})
---
name: startup_css
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39713
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/238718
group: group::editor
type: development
default_enabled: false
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment