Text Decoration Override SCSS
February 19, 2025 ยท AI Conversations
color: $primary;
text-decoration: none;
transition: color 0.3s ease, text-decoration 0.3s ease;
display: inline-block;
&:hover {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}
&:visited {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}
&:active {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}
}
prevent text-decoration underline for elementor-button-wrapper a
Zu unseren Services
### Solution:
Modify your SCSS to exclude `.elementor-button-wrapper a` from inheriting the underline styles.
#### **Updated SCSS**
a {
color: $primary;
text-decoration: none;
transition: color 0.3s ease, text-decoration 0.3s ease;
display: inline-block;
&:hover,
&:visited,
&:active {
color: $primary;
text-decoration: underline;
}
// Prevent text-decoration on elementor buttons
.elementor-button-wrapper & {
text-decoration: none !important;
}
}
### **Explanation:**
– The `text-decoration: none !important;` inside `.elementor-button-wrapper &` ensures that any “ inside `.elementor-button-wrapper` won't get underlined.
– `&` refers to `a` inside `.elementor-button-wrapper`, making it a more specific rule.
– The `!important` overrides any conflicting styles that might be applied elsewhere.
This will ensure regular links behave as expected, while Elementor buttons remain free of underline styles. ๐