Skip to content

Commit 2cdf5f2

Browse files
committed
chore: update css and script to adjust responsive design for doc
1 parent 54a73ae commit 2cdf5f2

File tree

1 file changed

+55
-22
lines changed

1 file changed

+55
-22
lines changed

ouds_core/assets/doc/orange_theme.html

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@
2323
--default-font-family: "Helvetica Neue", helvetica, "Noto Sans", "Liberation Sans", arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
2424

2525
--main-header-height: 110px;
26-
--navigation-padding-top: 10px;
27-
--navigation-padding-bottom: 0;
28-
--grid-margin: 16px;
2926
--sidebar-width: 300px;
3027

31-
--hero-image-height: 200px;
32-
3328
/* Font sizes */
3429
--font-size-body-small: 0.75rem;
3530
--font-size-body-medium: 0.875rem;
36-
--font-size-body-large: 1rem;
3731
--font-size-heading-small: 1.125rem;
3832
--font-size-heading-medium: 1.25rem;
3933
--font-size-heading-large: 1.5rem;
@@ -51,22 +45,11 @@
5145
--font-letter-spacing-heading-small: 0.18px;
5246
--font-letter-spacing-body-large: 0.2px;
5347

54-
--default-font-size: var(--font-size-body-large);
55-
--horizontal-spacing-for-content: var(--grid-margin);
5648
}
5749

5850
/* Media queries for responsive variables */
5951
@media (min-width: 736px) {
6052
:root {
61-
--dokka-logo-height: 48px;
62-
--dokka-logo-width: 48px;
63-
--logo-link-gap: 24px;
64-
--navigation-padding-top: 44px;
65-
--navigation-padding-bottom: 16px;
66-
--grid-margin: 32px;
67-
--hero-image-height: 170px;
68-
69-
--font-size-body-large: 1.125rem;
7053
--font-size-heading-small: 1.5rem;
7154
--font-size-heading-medium: 1.5rem;
7255
--font-size-heading-large: 2.25rem;
@@ -83,10 +66,6 @@
8366

8467
@media (min-width: 1024px) {
8568
:root {
86-
--grid-margin: 56px;
87-
--hero-image-height: 200px;
88-
89-
--font-size-body-large: 1.125rem;
9069
--font-size-heading-small: 1.5rem;
9170
--font-size-heading-medium: 1.75rem;
9271
--font-size-heading-large: 2.5rem;
@@ -101,6 +80,41 @@
10180
}
10281
}
10382

83+
@media screen and (max-width: 840px){
84+
85+
:root {
86+
--font-size-heading-medium: 1.5rem;
87+
}
88+
89+
#sidenav-left-toggle{
90+
display:inline;
91+
color:var(--white-color) !important;
92+
}
93+
#sidenav-left-toggle:hover{
94+
color:var(--color-key-orange) !important;
95+
}
96+
/* Taille du logo via CSS */
97+
.custom-logo {
98+
width: 20px;
99+
height: auto;
100+
margin-top: 10px;
101+
}
102+
103+
/* User name styling in header */
104+
header .self-name {
105+
font-size: var(--font-size-heading-medium) !important;
106+
margin-top: 10px;
107+
}
108+
109+
#theme-button {
110+
margin-top: 20px !important;
111+
}
112+
113+
#dartdoc-main-content {
114+
margin: 20px !important;
115+
}
116+
}
117+
104118
/* Body styles */
105119
body {
106120
white-space: normal;
@@ -331,6 +345,7 @@
331345
logoLink.href = 'https://flutter.unified-design-system.orange.com/';
332346
// Declare the logo image
333347
const logoImg = document.createElement('img');
348+
logoImg.className = 'custom-logo';
334349

335350
// Function to check and set the logo from multiple paths
336351
function checkAndSetLogo(paths, index = 0) {
@@ -351,7 +366,6 @@
351366
const link = document.createElement('a');
352367
link.href = 'https://flutter.unified-design-system.orange.com/';
353368
link.textContent = 'OUDS Flutter';
354-
link.textContent = 'OUDS Flutter';
355369
link.style.color = 'var(--white-color)';
356370
link.className = 'self-link';
357371
selfNameSpan.innerHTML = '';
@@ -497,5 +511,24 @@
497511
const element = document.querySelector('.package-name');
498512
element.textContent = 'Core Components';
499513

514+
document.addEventListener("DOMContentLoaded", () => {
515+
const toggleButton = document.getElementById('sidenav-left-toggle');
516+
const header = document.querySelector("header#title");
517+
518+
if (toggleButton && header) {
519+
// Créer le conteneur pour le logo si ce n'est pas déjà fait
520+
let headerLeft = document.querySelector('.header-left');
521+
if (!headerLeft) {
522+
headerLeft = document.createElement('div');
523+
headerLeft.className = 'header-left';
524+
header.appendChild(headerLeft);
525+
}
526+
527+
// Déplacer le bouton toggle dans le conteneur
528+
headerLeft.appendChild(toggleButton);
529+
}
530+
});
531+
532+
500533
</script>
501534
</footer>

0 commit comments

Comments
 (0)