Skip to content

Commit 407c304

Browse files
committed
Fix CSS lint errors in Callout and CallTOAction Contact, Download, and Featured files, refactor to use Tailwind theme classes
1 parent fc92140 commit 407c304

5 files changed

Lines changed: 12 additions & 126 deletions

File tree

‎src/components/CallToAction/Contact/index.astro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const {
4242
---
4343

4444
<section
45-
class="py-16 md:py-24 bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)] relative overflow-hidden"
45+
class="py-16 md:py-24 bg-linear-to-br from-(--color-primary) to-(--color-accent) relative overflow-hidden"
4646
>
4747
<!-- Decorative background elements -->
4848
<div class="absolute inset-0 opacity-10">
@@ -68,7 +68,7 @@ const {
6868
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
6969
<a
7070
href={primaryLink.href}
71-
class="inline-flex items-center justify-center px-8 py-4 bg-white text-[var(--color-primary)] font-semibold rounded-xl hover:bg-white/90 transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
71+
class="inline-flex items-center justify-center px-8 py-4 bg-white text-primary font-semibold rounded-xl hover:bg-white/90 transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
7272
>
7373
{primaryLink.text}
7474
<svg class="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -83,7 +83,7 @@ const {
8383
secondaryLink && (
8484
<a
8585
href={secondaryLink.href}
86-
class="inline-flex items-center justify-center px-8 py-4 bg-transparent border-2 border-white text-white font-semibold rounded-xl hover:bg-white hover:text-[var(--color-primary)] transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
86+
class="inline-flex items-center justify-center px-8 py-4 bg-transparent border-2 border-white text-white font-semibold rounded-xl hover:bg-white hover:text-primary transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
8787
>
8888
{secondaryLink.text}
8989
</a>

‎src/components/CallToAction/Download/README.md‎

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# Download Call-to-Action Component
22

3-
A visually striking call-to-action component that encourages users to download gated resources. The component links to download landing pages where users fill out a form to access the content.
4-
5-
## Features
6-
7-
- **Theme-Aware Styling**: Adapts to site themes with CSS custom properties
8-
- **Gradient Background**: Eye-catching gradient from primary to accent colors
9-
- **Animated Icon**: Download icon with hover animation
10-
- **Trust Indicators**: Shows "Instant Access", "No Credit Card Required", and "Expert Insights"
11-
- **Responsive Design**: Mobile-first approach with responsive breakpoints
12-
- **Accessible**: Semantic HTML with proper ARIA labels
13-
- **Customizable**: Flexible props for title, description, and button text
3+
A call-to-action component to encourage users to download gated resources. The component links to download landing pages where users fill out a form to access the content.
144

155
## Usage
166

@@ -72,23 +62,6 @@ The `resource` prop must match the folder name of a download in `src/content/dow
7262

7363
The component will construct the URL as `/downloads/{resource}` and navigate to that landing page when the button is clicked.
7464

75-
## Design Elements
76-
77-
### Visual Features
78-
79-
- **Gradient Background**: Uses primary and accent theme colors
80-
- **Decorative Blurs**: Subtle circular blur elements for depth
81-
- **Icon Badge**: Large download icon with semi-transparent background
82-
- **Hover Effects**: Smooth transitions and subtle lift on hover
83-
- **Trust Indicators**: Three icons with benefits displayed below the CTA
84-
85-
### Accessibility
86-
87-
- Semantic HTML5 `<section>` element
88-
- High contrast white text on colored background
89-
- Focus states for keyboard navigation
90-
- Screen reader friendly
91-
9265
## Customization
9366

9467
### Styling
@@ -118,80 +91,6 @@ This CTA component works seamlessly with the download system:
11891
4. **Access Granted**: After submission, download button appears
11992
5. **PDF Download**: User clicks to download the PDF in a new tab
12093

121-
## Example Placements
122-
123-
### In an Article
124-
125-
```astro
126-
---
127-
// In src/pages/articles/api-strategy.astro
128-
import Download from '@components/CallToAction/Download/index.astro'
129-
---
130-
131-
<article>
132-
<!-- Article content -->
133-
134-
<Download
135-
resource="api-tool-consolidation-whitepaper"
136-
title="Want to Learn More About API Consolidation?"
137-
description="Download our comprehensive whitepaper with case studies and implementation strategies."
138-
/>
139-
</article>
140-
```
141-
142-
### In a Service Page
143-
144-
```astro
145-
---
146-
// In src/pages/services/security-consulting.astro
147-
import Download from '@components/CallToAction/Download/index.astro'
148-
---
149-
150-
<main>
151-
<!-- Service information -->
152-
153-
<Download
154-
resource="ransomware-recovery-kit"
155-
title="Protect Your Organization Today"
156-
description="Get our complete ransomware recovery kit with prevention strategies and response protocols."
157-
secondaryLink={{
158-
href: "/contact",
159-
text: "Schedule Consultation"
160-
}}
161-
/>
162-
</main>
163-
```
164-
165-
## Validation
166-
167-
The component includes runtime validation:
168-
169-
- Throws an error if the `resource` prop is not provided
170-
- Ensures the component is used correctly
171-
172-
```typescript
173-
if (!resource) {
174-
const message = 'Download CTA component requires a "resource" prop'
175-
throw new ClientScriptError({ message })
176-
}
177-
```
178-
179-
## Browser Support
180-
181-
Works in all modern browsers that support:
182-
183-
- CSS Grid and Flexbox
184-
- CSS Custom Properties (CSS Variables)
185-
- CSS Backdrop Blur (graceful degradation)
186-
- SVG
187-
188-
## Performance
189-
190-
- Static component with no client-side JavaScript
191-
- Uses native HTML anchor tags for navigation
192-
- CSS transitions handled by GPU
193-
- Optimized SVG icons
194-
19594
## Related Components
19695

19796
- **DownloadForm** (`@components/Forms/Download/index.astro`): The form displayed on download landing pages

‎src/components/CallToAction/Download/index.astro‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
---
22
/**
33
* Download Call-to-Action Component
4-
*
5-
* A prominent call-to-action section encouraging users to download a resource.
6-
* Navigates to a download landing page where users fill out a form to access the resource.
7-
*
8-
* @example
9-
* ```astro
10-
* <Download resource="ransomware-recovery-kit" />
11-
* <Download
12-
* resource="api-tool-consolidation-whitepaper"
13-
* title="Download Our API Consolidation Guide"
14-
* description="Learn how to streamline your API tooling and boost developer productivity."
15-
* />
16-
* ```
174
*/
185
196
import { ClientScriptError } from '@components/scripts/errors'
@@ -53,7 +40,7 @@ const downloadUrl = `/downloads/${resource}`
5340
---
5441

5542
<section
56-
class="py-16 md:py-24 bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)] relative overflow-hidden"
43+
class="py-16 md:py-24 bg-linear-to-br from-(--color-primary) to-(--color-accent) relative overflow-hidden"
5744
>
5845
<!-- Decorative background elements -->
5946
<div class="absolute inset-0 opacity-10">
@@ -93,7 +80,7 @@ const downloadUrl = `/downloads/${resource}`
9380
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
9481
<a
9582
href={downloadUrl}
96-
class="inline-flex items-center justify-center px-8 py-4 bg-white text-[var(--color-primary)] font-semibold rounded-xl hover:bg-white/90 transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center group"
83+
class="inline-flex items-center justify-center px-8 py-4 bg-white text-primary font-semibold rounded-xl hover:bg-white/90 transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center group"
9784
>
9885
<svg
9986
class="w-5 h-5 mr-2 transition-transform duration-200 group-hover:translate-y-0.5"
@@ -114,7 +101,7 @@ const downloadUrl = `/downloads/${resource}`
114101
secondaryLink && (
115102
<a
116103
href={secondaryLink.href}
117-
class="inline-flex items-center justify-center px-8 py-4 bg-transparent border-2 border-white text-white font-semibold rounded-xl hover:bg-white hover:text-[var(--color-primary)] transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
104+
class="inline-flex items-center justify-center px-8 py-4 bg-transparent border-2 border-white text-white font-semibold rounded-xl hover:bg-white hover:text-primary transition-all duration-200 hover:shadow-xl hover:-translate-y-0.5 min-w-[200px] text-center"
118105
>
119106
{secondaryLink.text}
120107
</a>

‎src/components/CallToAction/Featured/index.astro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ const {
5353
<div class="py-8 md:py-12" data-audience={audience}>
5454
<aside class="container mx-auto px-4 sm:px-6 lg:px-8">
5555
<div
56-
class="bg-gradient-to-br from-[var(--color-success-bg)] to-[var(--color-info-bg)] rounded-2xl shadow-xl overflow-hidden"
56+
class="bg-linear-to-br from-(--color-success-bg) to-(--color-info-bg) rounded-2xl shadow-xl overflow-hidden"
5757
>
5858
<div class={`grid gap-8 ${image ? 'lg:grid-cols-2' : 'lg:grid-cols-1'} items-center`}>
5959
<!-- Content Column -->
6060
<div class="p-8 md:p-12 lg:p-16">
6161
<div class="max-w-xl">
6262
<h3
63-
class="text-2xl md:text-3xl lg:text-4xl font-bold text-[var(--color-text)] mb-4 leading-tight"
63+
class="text-2xl md:text-3xl lg:text-4xl font-bold text-text mb-4 leading-tight"
6464
>
6565
{title}
6666
</h3>
67-
<p class="text-base md:text-lg text-[var(--color-text-offset)] mb-8 leading-relaxed">
67+
<p class="text-base md:text-lg text-offset mb-8 leading-relaxed">
6868
{description}
6969
</p>
7070
<a href={link.href} class="inline-block">

‎src/components/Callout/index.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ const borderColor = borderColorMap[type]
5757
}
5858
</style>
5959

60-
<div class="callout border border-[var(--color-border)] border-l-0 rounded-r-lg relative pl-6">
60+
<div class="callout border border--border border-l-0 rounded-r-lg relative pl-6">
6161
<div
62-
class="callout__icon bg-[var(--color-bg)] rounded-full absolute left-0 top-0 ml-0.5 p-1 -translate-x-1/2 -translate-y-1/2"
62+
class="callout__icon bg-bg rounded-full absolute left-0 top-0 ml-0.5 p-1 -translate-x-1/2 -translate-y-1/2"
6363
>
6464
<Sprite name={icon} size={20} />
6565
</div>

0 commit comments

Comments
 (0)