Skip to content

Commit a029558

Browse files
authored
feat(openfga): show ask ai button on mobile (#1166)
1 parent 3654efa commit a029558

File tree

2 files changed

+62
-21
lines changed

2 files changed

+62
-21
lines changed

docusaurus.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ import dev.openfga.sdk.api.configuration.ClientConfiguration;`,
273273
{
274274
type: 'html',
275275
position: 'right',
276-
value: '<div class="navbar__item navbar__link ask-ai-button-wrapper"><button class="ask-ai-button" aria-label="Ask AI">Ask AI</button></div>',
276+
className: 'ask-ai-nav-item',
277+
value: '<button class="ask-ai-button ask-ai-nav-button" aria-label="Ask AI">Ask AI</button>',
277278
},
278279
],
279280
},

src/css/custom.css

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,22 @@ table td {
4141
overflow-wrap: break-word;
4242
}
4343

44-
/* Ask AI Button Styling */
45-
.ask-ai-button-wrapper {
46-
position: relative !important;
47-
order: 1000 !important;
48-
padding-left: 0.75rem !important;
49-
flex-shrink: 0 !important;
50-
margin-left: 0 !important;
51-
}
52-
44+
/* =========================
45+
Ask AI button styling
46+
========================= */
5347
.ask-ai-button {
5448
background: linear-gradient(135deg, var(--ofga-color-module) 0%, var(--ofga-color-relation) 100%);
55-
5649
color: var(--ofga-color-background) !important;
5750

5851
border: 1px solid color-mix(in srgb, var(--ofga-color-relation), var(--ofga-neutral-darkest) 70%);
5952
border-radius: 6px;
53+
6054
padding: 0.5rem 1rem;
6155
font-weight: 600;
6256
cursor: pointer;
6357
font-size: 0.9rem;
58+
white-space: nowrap;
59+
6460
transition:
6561
background 0.25s ease,
6662
transform 0.25s ease,
@@ -78,24 +74,68 @@ table td {
7874
transform: translateY(0);
7975
}
8076

81-
.navbar__items.navbar__items--right {
82-
display: flex !important;
83-
flex-wrap: nowrap !important;
77+
.navbar__items--right {
78+
display: flex;
79+
align-items: center;
80+
flex-wrap: nowrap;
81+
gap: 12px;
8482
}
8583

86-
.navbar__items--right > .navbarSearchContainer_Bca1 {
87-
order: 999 !important;
84+
.navbar__items--right .navbarSearchContainer_Bca1 {
85+
order: 1;
8886
}
8987

90-
.navbar__items--right > .navbar__item:has(.ask-ai-button-wrapper) {
91-
order: 1000 !important;
88+
.navbar__items--right .ask-ai-nav-item {
89+
order: 2;
9290
}
9391

92+
/* Mobile Layout */
93+
9494
@media (max-width: 996px) {
95-
.ask-ai-button {
95+
.navbar__items--right .header-social {
96+
display: none;
97+
}
98+
99+
.navbar-sidebar .ask-ai-nav-item {
100+
display: none;
101+
}
102+
103+
.navbar__items--right {
104+
position: relative;
105+
--ask-ai-mobile-width: 92px;
106+
}
107+
108+
.navbar__items--right > .ask-ai-nav-item {
96109
display: block;
110+
position: absolute;
111+
right: 0;
112+
top: 50%;
113+
transform: translateY(-50%);
114+
z-index: 0;
115+
}
116+
117+
.navbar__items--right .ask-ai-nav-button {
118+
width: var(--ask-ai-mobile-width);
119+
padding: 0.45rem 0.75rem;
120+
font-size: 0.85rem;
121+
margin: 0;
122+
}
123+
124+
.navbar__items--right [class*='navbarSearchContainer'] {
125+
order: 1;
126+
margin-right: calc(var(--ask-ai-mobile-width) + 20px);
127+
flex: 1 1 auto;
128+
min-width: 0;
129+
position: static;
130+
}
131+
132+
.navbar__items--right .searchBar_RVTs {
133+
width: 100%;
134+
min-width: 0;
135+
}
136+
137+
.navbar__items--right .navbar__search-input {
97138
width: 100%;
98-
text-align: center;
99-
margin: 0.5rem 0;
139+
min-width: 0;
100140
}
101141
}

0 commit comments

Comments
 (0)