Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2ca202df
Commit
2ca202df
authored
Aug 20, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tz-activate-startupcss' into 'master'
Activate Startup.CSS See merge request gitlab-org/gitlab!39713
parents
36fc17c3
a38699e0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+2
-4
app/views/layouts/_startup_css.haml
app/views/layouts/_startup_css.haml
+2
-5
app/views/layouts/_startup_css_activation.haml
app/views/layouts/_startup_css_activation.haml
+7
-0
config/feature_flags/development/startup_css.yml
config/feature_flags/development/startup_css.yml
+7
-0
No files found.
app/helpers/application_helper.rb
View file @
2ca202df
...
@@ -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
)
...
...
app/views/layouts/_head.html.haml
View file @
2ca202df
...
@@ -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
)
...
...
app/views/layouts/_startup_css.haml
View file @
2ca202df
-
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});
})
app/views/layouts/_startup_css_activation.haml
0 → 100644
View file @
2ca202df
-
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});
})
config/feature_flags/development/startup_css.yml
0 → 100644
View file @
2ca202df
---
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment