Refactor privacy page styles: eliminate duplication and !important
- Create shared back-link-styles mixin in _mixins.scss for reusable button component - Remove all duplicate back-link styling from .privacy-content .back-link and a.back-link - Eliminate 15+ instances of !important declarations throughout privacy styles - Use proper SCSS variables instead of hardcoded values for consistent spacing - Add focus state to back-link mixin for accessibility compliance - Use existing card mixin and flex-center mixin for consistent styling - Replace hardcoded colors with CSS custom properties for theme compatibility Benefits: - DRY principle: One mixin defines all back-link styles - Better maintainability: Changes in one place affect all instances - Improved accessibility: Focus states for keyboard navigation - Cleaner CSS: No !important declarations needed - Theme consistency: Uses proper color variables
This commit is contained in:
parent
8d1d62288a
commit
ebee173f2c
2 changed files with 59 additions and 64 deletions
|
@ -122,6 +122,31 @@
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Back-link button mixin (shared component)
|
||||||
|
@mixin back-link-styles {
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: $spacing-lg;
|
||||||
|
padding: $spacing-sm $spacing-md;
|
||||||
|
color: white;
|
||||||
|
background-color: var(--primary-color, $primary-color);
|
||||||
|
border: none;
|
||||||
|
border-radius: $border-radius-sm;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-hover, $secondary-color);
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: 2px solid currentColor;
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Responsive breakpoint mixins
|
// Responsive breakpoint mixins
|
||||||
@mixin mobile {
|
@mixin mobile {
|
||||||
@media (max-width: $mobile) {
|
@media (max-width: $mobile) {
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
|
// Import variables and mixins
|
||||||
|
@use '../variables' as *;
|
||||||
|
@use '../mixins' as *;
|
||||||
|
|
||||||
// Privacy page specific styles
|
// Privacy page specific styles
|
||||||
.privacy-container {
|
.privacy-container {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 20px;
|
padding: $spacing-md;
|
||||||
}
|
}
|
||||||
|
|
||||||
.privacy-header {
|
.privacy-header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 40px;
|
margin-bottom: $spacing-xl;
|
||||||
|
|
||||||
&__title-wrapper {
|
&__title-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 20px;
|
margin-bottom: $spacing-md;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title-content {
|
&__title-content {
|
||||||
|
@ -27,32 +31,27 @@
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
display: flex;
|
@include flex-center;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
box-shadow: 0 2px 4px var(--shadow);
|
box-shadow: 0 2px 4px var(--shadow);
|
||||||
|
|
||||||
.theme-icon {
|
.theme-icon {
|
||||||
font-size: 20px;
|
font-size: $font-size-lg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.privacy-content {
|
.privacy-content {
|
||||||
background: var(--card-bg);
|
@include card($spacing-lg);
|
||||||
padding: 30px;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 2px 4px var(--shadow);
|
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
margin-top: 30px;
|
margin-top: $spacing-lg;
|
||||||
margin-bottom: 15px;
|
margin-bottom: $spacing-md;
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--border-color);
|
||||||
padding-bottom: 10px;
|
padding-bottom: $spacing-sm;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
@ -60,87 +59,58 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
margin: 15px 0;
|
margin: $spacing-md 0;
|
||||||
padding-left: 30px;
|
padding-left: $spacing-lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
margin-bottom: 8px;
|
margin-bottom: $spacing-xs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix link visibility and styling
|
// Regular links within content (higher specificity than base styles)
|
||||||
a:not(.back-link) {
|
a:not(.back-link) {
|
||||||
color: var(--link-color) !important;
|
color: var(--link-color);
|
||||||
text-decoration: underline !important;
|
text-decoration: underline;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--link-hover) !important;
|
color: var(--link-hover);
|
||||||
text-decoration: underline !important;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Back-link button using shared mixin
|
||||||
.back-link {
|
.back-link {
|
||||||
display: inline-block !important;
|
@include back-link-styles;
|
||||||
margin-top: 30px !important;
|
|
||||||
padding: 10px 20px !important;
|
|
||||||
color: white !important;
|
|
||||||
background-color: var(--primary-color, #2196F3) !important;
|
|
||||||
border: none !important;
|
|
||||||
border-radius: 4px !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
transition: background-color 0.2s ease !important;
|
|
||||||
font-weight: 500 !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--primary-hover, #1976D2) !important;
|
|
||||||
color: white !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.effective-date {
|
.effective-date {
|
||||||
color: #666;
|
color: var(--text-secondary);
|
||||||
font-size: 0.9em;
|
font-size: $font-size-sm;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 30px;
|
margin-bottom: $spacing-lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-info {
|
.contact-info {
|
||||||
background: var(--toggle-bg);
|
background: var(--bg-secondary);
|
||||||
padding: 20px;
|
padding: $spacing-md;
|
||||||
border-radius: 6px;
|
border-radius: $border-radius-sm;
|
||||||
margin-top: 20px;
|
margin-top: $spacing-md;
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--link-color) !important;
|
color: var(--link-color);
|
||||||
text-decoration: underline !important;
|
text-decoration: underline;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--link-hover) !important;
|
color: var(--link-hover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global back-link styling (for cases where it's used outside .privacy-content)
|
// Global back-link styling (for cases where it's used outside .privacy-content)
|
||||||
a.back-link {
|
a.back-link {
|
||||||
display: inline-block !important;
|
@include back-link-styles;
|
||||||
margin-top: 30px !important;
|
|
||||||
padding: 10px 20px !important;
|
|
||||||
color: white !important;
|
|
||||||
background-color: var(--primary-color, #2196F3) !important;
|
|
||||||
border: none !important;
|
|
||||||
border-radius: 4px !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
transition: background-color 0.2s ease !important;
|
|
||||||
font-weight: 500 !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--primary-hover, #1976D2) !important;
|
|
||||||
color: white !important;
|
|
||||||
text-decoration: none !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue