2
Override Theme styles with custom selector for more CSS specificity
Source: elementor/elementor#17598 · opened by @ashbryant
I've had this issue a couple of times now where a theme being used has more weight on its CSS selectors than that of Elementor's and thus Elementor's styles are overridden by those of the theme.
I've managed to 'fixed' this by adding in a selector to the the elementor > includes > stylesheet.php (line 74) that then increases the weight of elementor's styles, but being able to do this from the admin would obviously be best as any changes here will need to be replicated every-time elementor updates.
public static function parse_rules( array $rules ) {
$parsed_rules = '';
foreach ( $rules as $selector => $properties ) {
$selector_content = self::parse_properties( $properties );
if ( $selector_content ) {
$parsed_rules .= '#increase-weight-selector-name-here ' . $selector . '{' . $selector_content . '}';
}
}
return $parsed_rules;
}
I've managed to 'fixed' this by adding in a selector to the the elementor > includes > stylesheet.php (line 74) that then increases the weight of elementor's styles, but being able to do this from the admin would obviously be best as any changes here will need to be replicated every-time elementor updates.
public static function parse_rules( array $rules ) {
$parsed_rules = '';
foreach ( $rules as $selector => $properties ) {
$selector_content = self::parse_properties( $properties );
if ( $selector_content ) {
$parsed_rules .= '#increase-weight-selector-name-here ' . $selector . '{' . $selector_content . '}';
}
}
return $parsed_rules;
}
No pledges yet. Be the first to back this.
Comments
Similar requests
Throw Elementor styles in @layer or :where()
5 votes · 0 comments
Child Themes require important
1 vote · 0 comments
🔗 Make Custom CSS Control Responsive
4 votes · 0 comments
Element Manager for Custom CSS
4 votes · 0 comments
🐞 Bug Report: Add a per-page custom css section, as opposed to the current, per element.
1 vote · 0 comments
No comments yet.