Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6eb5f93

Browse files
bug #29184 [WebProfilerBundle] Fix theme settings (ro0NL)
This PR was squashed before being merged into the 4.2-dev branch (closes #29184). Discussion ---------- [WebProfilerBundle] Fix theme settings | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #28932 #28935 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Commits ------- 8fbe85c [WebProfilerBundle] Fix theme settings
2 parents fb249f0 + 8fbe85c commit 6eb5f93

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</head>
1616
<body>
1717
<script async>
18-
document.body.classList.add(localStorage.getItem('symfony/profiler/theme'), localStorage.getItem('symfony/profiler/width'));
18+
document.body.classList.add(localStorage.getItem('symfony/profiler/theme') || 'theme-light', localStorage.getItem('symfony/profiler/width') || 'width-normal');
1919
</script>
2020

2121
{% block body '' %}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/settings.html.twig

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<style>
22
#open-settings {
3-
color: var(--text-muted);
3+
color: var(--color-muted);
44
display: block;
55
margin: 15px 15px 5px;
66
}
@@ -84,6 +84,24 @@
8484
.modal-content .form-help + h4 {
8585
margin-top: 45px;
8686
}
87+
88+
@media (max-width: 768px) {
89+
#open-settings {
90+
color: transparent;
91+
}
92+
#sidebar:hover #open-settings, #sidebar.expanded #open-settings {
93+
color: var(--color-muted);
94+
}
95+
#open-settings:before {
96+
content: '\2699';
97+
font-weight: bold;
98+
font-size: 25px;
99+
color: var(--color-muted);
100+
}
101+
#sidebar:hover #open-settings:before, #sidebar.expanded #open-settings:before {
102+
content: '';
103+
}
104+
}
87105
</style>
88106

89107
<a href="#" id="open-settings" data-triger="profiler-settings">Settings</a>
@@ -141,8 +159,8 @@
141159
let modalWrapper = document.getElementsByClassName('modal-wrap')[0]
142160
143161
openModalButton.addEventListener('click', function(event) {
144-
document.getElementById('settings-' + localStorage.getItem('symfony/profiler/theme')).checked = 'checked';
145-
document.getElementById('settings-' + localStorage.getItem('symfony/profiler/width')).checked = 'checked';
162+
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/theme') || 'theme-light')).checked = 'checked';
163+
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/width') || 'width-normal')).checked = 'checked';
146164
147165
modalWindow.classList.toggle('visible');
148166
event.preventDefault();

0 commit comments

Comments
 (0)