false, 'selector' => $order_class, 'declaration' => '--dtq-toc-accent:' . ( $active_color ? $active_color : '#2ea3f2' ) . ';', ); $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-title", 'declaration' => "margin-bottom:{$title_spacing};", ); // !important on list-style + spacing so they beat theme ID selectors // (e.g. `#left-area ul`) that also style these properties. $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list, {$order_class} .dtq-toc-list ul", 'declaration' => "list-style-type:{$list_style} !important;", ); // Spacing: adjacent-sibling margin-top only — no trailing margins to // accumulate where a nested sub-list returns to a top-level item. $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list ul", 'declaration' => "padding-left:{$level_indent} !important;margin-top:{$item_spacing} !important;", ); $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-item + .dtq-toc-item", 'declaration' => "margin-top:{$item_spacing} !important;", ); if ( $link_padding ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list a", 'declaration' => "padding:{$link_padding};", ); } if ( $link_color ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list a", 'declaration' => "color:{$link_color};", ); } if ( $hover_color ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list a:hover", 'declaration' => "color:{$hover_color};", ); } if ( $active_color ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list .dtq-toc-active > a", 'declaration' => "color:{$active_color};", ); } if ( $active_bg ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list .dtq-toc-active > a", 'declaration' => "background-color:{$active_bg};", ); } if ( $marker_color ) { $custom_styles[] = array( 'atRules' => false, 'selector' => "{$order_class} .dtq-toc-list li::marker", 'declaration' => "color:{$marker_color};", ); } $all_styles = array( // styleProps.disabledOn must be passed here as well as in styles.jsx, // or "Disable On" is honoured in the builder and ignored on the front end. $elements->style( array( 'attrName' => 'module', 'styleProps' => array( 'disabledOn' => array( 'disabledModuleVisibility' => $settings['disabledModuleVisibility'] ?? null, ), ), ) ), $elements->style( array( 'attrName' => 'titleFont' ) ), $elements->style( array( 'attrName' => 'linkFont' ) ), $custom_styles, ); $all_styles[] = CssStyle::style( array( 'selector' => $order_class, 'attr' => $attrs['css'] ?? array(), 'cssFields' => self::custom_css_fields(), ) ); Style::add( array( 'id' => $args['id'], 'name' => $args['name'], 'orderIndex' => $args['orderIndex'], 'storeInstance' => $args['storeInstance'], 'styles' => $all_styles, ) ); } }