Commit 12f83db6 authored by Tim Zallmann's avatar Tim Zallmann

Remove StartupCSS Checks

Updated for test setup, restructured startup setup

Restructured to have a feature flag in place
for startup_css
parent bf4c9023
......@@ -236,11 +236,11 @@ module ApplicationHelper
end
def use_startup_css?
params[:startup_css] == 'true' || cookies['startup_css'] == 'true'
Feature.enabled?(:startup_css)
end
def stylesheet_link_tag_defer(path)
if use_startup_css?
if use_startup_css? && !Rails.env.test?
stylesheet_link_tag(path, media: "print")
else
stylesheet_link_tag(path, media: "all")
......
......@@ -49,9 +49,7 @@
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
- if use_startup_css?
%style{ type: "text/css" }
= Rails.application.assets_manifest.find_sources('startup/startup-general.css').first.to_s.html_safe
= render 'layouts/startup_css'
- if user_application_theme == 'gl-dark'
= stylesheet_link_tag_defer "application_dark"
- else
......@@ -61,7 +59,7 @@
= 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)
......
- 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});
})
%style{ type: "text/css" }
= Rails.application.assets_manifest.find_sources('startup/startup-general.css').first.to_s.html_safe
- 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