Skip to content

Commit c039c2b

Browse files
committed
Styles for consent form
1 parent 096b64d commit c039c2b

4 files changed

Lines changed: 90 additions & 95 deletions

File tree

‎src/components/Pages/Consent/index.astro‎

Lines changed: 59 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export type Props = {
1111
description: string
1212
}
1313
intro: string
14+
introLinks: {
15+
privacyPolicyText: string
16+
myDataText: string
17+
}
1418
essential: {
1519
heading: string
1620
subheading: string
@@ -75,49 +79,53 @@ export type Props = {
7579
const { content } = Astro.props
7680
---
7781

78-
<div class="mx-auto px-4 sm:px-6 lg:px-8 py-2 md:py-4">
79-
<header class="text-center max-w-2xl mx-auto mb-8">
82+
<div class="max-w-4xl mx-auto w-full block py-2 md:py-4">
83+
<header class="text-center max-w-2xl mx-auto mb-2">
8084
<div class="inline-flex items-center justify-center w-18 h-18 rounded-full bg-primary/10 mb-5">
8185
<Icon
82-
icon="avatar"
86+
icon="lock"
8387
color="page-inverse"
8488
size={12}
8589
/>
8690
</div>
87-
<h1 class="text-4xl md:text-5xl font-bold text-page-inverse mb-4">{content.header.title}</h1>
88-
<p class="text-lg text-content-offset leading-relaxed mb-4">
91+
<h1 class="font-bold text-page-inverse mb-4">{content.header.title}</h1>
92+
<p class="text-lg text-content-offset leading-relaxed">
8993
{content.header.description}
9094
</p>
9195
</header>
9296

93-
<consent-preferences class="block w-full mb-12">
97+
<consent-preferences class="mb-2">
9498
<section
95-
class="bg-content-inverse rounded-2xl shadow-2xl max-w-4xl mx-auto w-full"
9699
aria-labelledby="consent-preferences__title"
97100
aria-describedby="consent-preferences__settings-desc"
98101
>
99-
<div class="px-6 py-8">
102+
<div class="px-6 pt-8 pb-2">
100103
{/* Introduction */}
101-
<div class="mb-8">
102-
<p id="consent-preferences__settings-desc" class="leading-relaxed">
103-
{content.intro}
104-
</p>
104+
<div class="bg-page-offset rounded-xl p-6 mb-4">
105+
<p class="leading-relaxed text-md">{content.intro}</p>
106+
<div class="mt-4 flex justify-evenly">
107+
<a
108+
href="/privacy"
109+
class="text-page-inverse underline decoration-page-inverse decoration-dotted underline-offset-4 hover:text-secondary hover:decoration-secondary focus-visible:outline-2 focus-visible:outline-spotlight focus-visible:outline-offset-2"
110+
>
111+
{content.introLinks.privacyPolicyText}
112+
</a>
113+
<a
114+
href="/privacy/my-data"
115+
class="text-page-inverse underline decoration-page-inverse decoration-dotted underline-offset-4 hover:text-secondary hover:decoration-secondary focus-visible:outline-2 focus-visible:outline-spotlight focus-visible:outline-offset-2"
116+
>
117+
{content.introLinks.myDataText}
118+
</a>
119+
</div>
105120
</div>
106121

107122
{/* Data Storage Categories */}
108123
<div class="space-y-6">
109124
{/* Essential Data */}
110-
<div class="border border-gray-200 dark:border-gray-700 rounded-xl p-6">
111-
<div class="flex items-center justify-between mb-4">
125+
<div class="bg-page-offset rounded-xl p-6">
126+
<div class="flex items-center justify-between mb-1">
112127
<div>
113-
<h3
114-
class="text-lg font-semibold text-gray-900 dark:text-white"
115-
id="consent-preferences__essential-title"
116-
>
117-
{content.essential.heading}
118-
<HeadingAnchor href={"#consent-preferences__essential-title"} />
119-
</h3>
120-
<p class="text-sm text-gray-600 dark:text-gray-400">{content.essential.subheading}</p>
128+
<h3 class="text-xl font-semibold text-primary-offset">{content.essential.heading}</h3>
121129
</div>
122130
<div class="flex items-center">
123131
<span
@@ -127,28 +135,15 @@ const { content } = Astro.props
127135
</span>
128136
</div>
129137
</div>
130-
<p class="text-gray-600 dark:text-gray-300 text-sm leading-relaxed">
131-
{content.essential.description}
132-
</p>
138+
<p class="text-sm text-content-offset mb-3">{content.essential.subheading}</p>
139+
<p class="text-content text-md leading-relaxed">{content.essential.description}</p>
133140
</div>
134141

135142
{/* Performance and Analytics */}
136-
<div class="border border-gray-200 dark:border-gray-700 rounded-xl p-6">
137-
<div class="flex items-center justify-between mb-4">
143+
<div class="bg-page-offset rounded-xl p-6">
144+
<div class="flex items-center justify-between mb-1">
138145
<div>
139-
<h3
140-
id="consent-preferences__analytics-title"
141-
class="text-lg font-semibold text-gray-900 dark:text-white"
142-
>
143-
{content.analytics.heading}
144-
<HeadingAnchor href={"#consent-preferences__analytics-title"} />
145-
</h3>
146-
<p
147-
id="consent-preferences__analytics-desc"
148-
class="text-sm text-gray-600 dark:text-gray-400"
149-
>
150-
{content.analytics.subheading}
151-
</p>
146+
<h3 class="text-xl font-semibold text-primary-offset">{content.analytics.heading}</h3>
152147
</div>
153148
<label
154149
class="relative inline-flex items-center cursor-pointer"
@@ -164,33 +159,20 @@ const { content } = Astro.props
164159
checked
165160
/>
166161
<div
167-
class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
162+
class="w-11 h-6 bg-content peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
168163
>
169164
</div>
170165
</label>
171166
</div>
172-
<p class="text-gray-600 dark:text-gray-300 text-sm leading-relaxed">
173-
{content.analytics.description}
174-
</p>
167+
<p class="text-sm text-content-offset mb-3">{content.analytics.subheading}</p>
168+
<p class="text-content text-md leading-relaxed">{content.analytics.description}</p>
175169
</div>
176170

177171
{/* Functional */}
178-
<div class="border border-gray-200 dark:border-gray-700 rounded-xl p-6">
179-
<div class="flex items-center justify-between mb-4">
172+
<div class="bg-page-offset rounded-xl p-6">
173+
<div class="flex items-center justify-between mb-1">
180174
<div>
181-
<h3
182-
id="consent-preferences__functional-title"
183-
class="text-lg font-semibold text-gray-900 dark:text-white"
184-
>
185-
{content.functional.heading}
186-
<HeadingAnchor href={"#consent-preferences__functional-title"} />
187-
</h3>
188-
<p
189-
id="consent-preferences__functional-desc"
190-
class="text-sm text-gray-600 dark:text-gray-400"
191-
>
192-
{content.functional.subheading}
193-
</p>
175+
<h3 class="text-xl font-semibold text-primary-offset">{content.functional.heading}</h3>
194176
</div>
195177
<label
196178
class="relative inline-flex items-center cursor-pointer"
@@ -205,38 +187,23 @@ const { content } = Astro.props
205187
aria-describedby="consent-preferences__functional-desc"
206188
/>
207189
<div
208-
class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
190+
class="w-11 h-6 bg-content peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
209191
>
210192
</div>
211193
</label>
212194
</div>
213-
<p class="text-gray-600 dark:text-gray-300 text-sm leading-relaxed mb-3">
214-
{content.functional.description}
215-
</p>
216-
<div
217-
class="bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4"
218-
>
219-
<p class="text-sm text-blue-800 dark:text-blue-200 leading-relaxed" set:html={content.functional.trailer}></p>
195+
<p class="text-sm text-content-offset mb-3">{content.functional.subheading}</p>
196+
<p class="text-content text-md leading-relaxed">{content.functional.description}</p>
197+
<div class="bg-content-inverse-active rounded-lg p-4 mt-4 -mx-1">
198+
<p class="text-sm text-secondary leading-relaxed" set:html={content.functional.trailer}></p>
220199
</div>
221200
</div>
222201

223202
{/* Marketing */}
224-
<div class="border border-gray-200 dark:border-gray-700 rounded-xl p-6">
225-
<div class="flex items-center justify-between mb-4">
203+
<div class="bg-page-offset rounded-xl p-6">
204+
<div class="flex items-center justify-between mb-1">
226205
<div>
227-
<h3
228-
id="consent-preferences__marketing-title"
229-
class="text-lg font-semibold text-gray-900 dark:text-white"
230-
>
231-
{content.marketing.heading}
232-
<HeadingAnchor href={"#consent-preferences__marketing-title"} />
233-
</h3>
234-
<p
235-
id="consent-preferences__marketing-desc"
236-
class="text-sm text-gray-600 dark:text-gray-400"
237-
>
238-
{content.marketing.subheading}
239-
</p>
206+
<h3 class="text-xl font-semibold text-primary-offset">{content.marketing.heading}</h3>
240207
</div>
241208
<label
242209
class="relative inline-flex items-center cursor-pointer"
@@ -251,19 +218,24 @@ const { content } = Astro.props
251218
aria-describedby="consent-preferences__marketing-desc"
252219
/>
253220
<div
254-
class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
221+
class="w-11 h-6 bg-content peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
255222
>
256223
</div>
257224
</label>
258225
</div>
259-
<p class="text-gray-600 dark:text-gray-300 text-sm leading-relaxed">
260-
{content.marketing.description}
261-
</p>
226+
<p class="text-sm text-content-offset mb-3">{content.marketing.subheading}</p>
227+
<p class="text-content text-md leading-relaxed">{content.marketing.description}</p>
262228
</div>
263229
</div>
264230
</div>
265231

266-
<div class="bg-content-inverse border-t border-page-offset px-6 py-4 flex gap-3 justify-end flex-wrap">
232+
<div class="px-6 py-4 flex gap-3 justify-end flex-wrap">
233+
<button
234+
id="consent-allow-all"
235+
class="px-6 py-2 bg-spotlight text-white rounded-lg hover:bg-spotlight-offset transition-colors duration-200 font-medium"
236+
>
237+
{content.buttons.acceptAll}
238+
</button>
267239
<button
268240
id="consent-deny-all"
269241
class="px-6 py-2 bg-spotlight rounded-lg hover:bg-spotlight-offset transition-colors duration-200 font-medium"
@@ -278,12 +250,6 @@ const { content } = Astro.props
278250
>
279251
{content.buttons.save}
280252
</button>
281-
<button
282-
id="consent-allow-all"
283-
class="px-6 py-2 bg-spotlight text-white rounded-lg hover:bg-spotlight-offset transition-colors duration-200 font-medium"
284-
>
285-
{content.buttons.acceptAll}
286-
</button>
287253
</div>
288254
</section>
289255
</consent-preferences>

‎src/components/Pages/Privacy/index.astro‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export type Props = {
2020
}
2121
nav: {
2222
title: string
23+
links: {
24+
consentPreferencesText: string
25+
myDataText: string
26+
}
2327
items: {
2428
label: string
2529
href: string
@@ -181,7 +185,23 @@ for (const [index, item] of content.nav.items.entries()) {
181185
</header>
182186

183187
<nav aria-label="Privacy policy sections" class="bg-content-active rounded-xl p-6 mb-8">
184-
<p class="text-md font-semibold text-content-inverse ml-2 mb-3">{content.nav.title}</p>
188+
<div class="mb-3 flex flex-col items-start gap-3 pl-2 md:flex-row md:items-center md:justify-between">
189+
<p class="text-md font-semibold text-content-inverse mb-0">{content.nav.title}</p>
190+
<div class="flex w-full items-center justify-center gap-3 md:w-auto md:justify-end">
191+
<a
192+
href="/consent"
193+
class="text-content-inverse underline decoration-content-inverse decoration-dotted underline-offset-4 hover:text-content-offset hover:decoration-content-offset focus-visible:outline-2 focus-visible:outline-spotlight focus-visible:outline-offset-2 md:mr-8"
194+
>
195+
{content.nav.links.consentPreferencesText}
196+
</a>
197+
<a
198+
href="/privacy/my-data"
199+
class="text-content-inverse underline decoration-content-inverse decoration-dotted underline-offset-4 hover:text-content-offset hover:decoration-content-offset focus-visible:outline-2 focus-visible:outline-spotlight focus-visible:outline-offset-2 md:mr-16"
200+
>
201+
{content.nav.links.myDataText}
202+
</a>
203+
</div>
204+
</div>
185205
<div class="flex flex-wrap items-center gap-y-2 md:gap-x-2 text-md md:ml-6">
186206
{
187207
navItems.map(({ href, label, showSeparator }) => (

‎src/pages/consent/index.astro‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const description =
1515
description: "Manage your cookie preferences and learn how we use cookies to improve your experience.",
1616
},
1717
intro: "When you visit our website, we may store information in your browser or device to make the site work and provide a better experience. This includes both cookies and local storage. The information we collect might relate to you, your preferences, or your device. You can choose which types of data storage to allow, though some choices may affect how the site works. Click on the different categories below to learn more and customize your preferences.",
18+
introLinks: {
19+
privacyPolicyText: "Privacy Policy",
20+
myDataText: "My Data Rights",
21+
},
1822
essential: {
1923
heading: "Essential Data",
2024
subheading: "Always Active - Required for the website to work",
@@ -38,13 +42,14 @@ const description =
3842
description: "These tools help identify unique browsing sessions to show generic ads. We don't collect information to show you targeted ads based on your behavior. However, advertising partners may use these tools to build a profile of your interests and show you relevant ads on other sites. They don't store personal information directly, but identify your browser and device. If you opt out, you may see less relevant advertising.",
3943
},
4044
buttons: {
41-
save: "Save My Preferences",
45+
save: "Save",
4246
acceptAll: "Accept All",
4347
rejectAll: "Decline All",
4448
},
4549
cookies: {
4650
heading: "What Are Cookies?",
4751
subheading: "Cookies are small text files that are stored on your computer or mobile device when you visit our website. They help us provide you with a better experience by remembering your preferences and understanding how you use our site.",
52+
description: "Cookies are small text files that are stored on your computer or mobile device when you visit our website. They help us provide you with a better experience by remembering your preferences and understanding how you use our site.",
4853
types: [
4954
{
5055
title: "Session Cookies",

‎src/pages/privacy/index.astro‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const description =
1818
},
1919
nav: {
2020
title: "Jump to:",
21+
links: {
22+
consentPreferencesText: "Consent Preferences",
23+
myDataText: "My Data",
24+
},
2125
items: [
2226
{
2327
label: "Collection",

0 commit comments

Comments
 (0)