pixelgrade / customify

Intuitive Website Styling integrated into WordPress' Customizer
GNU General Public License v2.0
28 stars 5 forks source link

Review config CSS array and callbacks #113

Closed razwan closed 6 years ago

vladolaru commented 6 years ago

@razwan I couldn't replicate the issues (the logic seems solid). I will close here and you can open a new issue when the problem arises again.

razwan commented 6 years ago
                'body_color'                                => array(
                    'type'    => 'color',
                    'label'   => esc_html__( 'Body Text Color', 'hive_txtd' ),
                    'live'    => true,
                    'default' => '#3d3e40',
                    'css'     => array(
                        array(
                            'selector' => '
                                body, 
                                .entry-title a, 
                                .nav--toolbar a:before, 
                                .site-title a,
                                .widget a,
                                .comment__author-name a,
                                a:hover',
                            'property' => 'color',
                        ),
                        array(
                            'selector' => '
                                .widget .post-date,
                                .recentcomments,
                                .single .entry-footer a, 
                                .page .entry-footer a,
                                .comment__content',
                            'property' => 'color',
                            'callback_filter' => 'hive_color_opacity_adjust_cb'
                        ),
                        array(
                            'selector' => '
                                .comment-number, 
                                .comments-area:after, 
                                .comment-number--dark, 
                                .comment-reply-title:before, 
                                .add-comment .add-comment__button,
                                .comment__timestamp,

                                .wp-caption-text, 
                                .single .entry-featured__caption, 
                                .page .entry-featured__caption,

                                .comment-edit-link, 
                                .comment-reply-link,

                                .single .entry-content:before, 
                                .page .entry-content:before',
                            'property' => 'color',
                            'callback_filter' => 'hive_color_opacity_darker_cb'
                        ),
                        array(
                            'selector' => '
                                .site-description:after,
                                li.comment .children li .comment-number, 
                                li.pingback .children li .comment-number, 
                                li.trackback .children li .comment-number',
                            'property' => 'background-color',
                            'callback_filter' => 'hive_color_opacity_darker_cb'
                        ),
                        array(
                            'selector' => '
                                .nav--toolbar a:hover, 
                                blockquote:after,
                                input,
                                textarea',
                            'property' => 'border-color',
                            'callback_filter' => 'hive_color_opacity_adjust_cb'
                        ),
                        array(
                            'selector' => '
                                .comment-number, 
                                .comments-area:after, 
                                .comment-number--dark, 
                                .comment-reply-title:before, 
                                .add-comment .add-comment__button,
                                .comment-form-comment textarea, 
                                .comment-subscription-form textarea,
                                .comment-form input, 
                                .comment-form textarea',
                            'property' => 'border-color',
                            'callback_filter' => 'hive_color_opacity_darker_cb'
                        ),
                        array(
                            'selector' => '.comments-area',
                            'property' => 'border-top-color',
                            'callback_filter' => 'hive_color_opacity_adjust_cb'
                        ),
                        array(
                            'selector' => '
                                .btn, 
                                .btn:hover, 
                                .btn:active, 
                                .btn:focus, 
                                input[type="submit"], 
                                input[type="submit"]:hover, 
                                input[type="submit"]:active, 
                                input[type="submit"]:focus, 
                                div#infinite-handle button, 
                                div#infinite-handle button:hover, 
                                div#infinite-handle button:active, 
                                div#infinite-handle button:focus,

                                .comment-number--dark[class], 
                                .comments-area:after, 
                                .comment-reply-title:before, 
                                .add-comment .add-comment__button,

                                .archive__grid .entry-thumbnail .hover__bg',
                            'property' => 'background-color',
                        ),
                        array(
                            'selector' => '.nav--main ul',
                            'property' => 'background-color',
                            'media' => 'only screen and (min-width: 1000px)'
                        ),
                        array(
                            'selector' => '.nav--main .menu-item-has-children > a:after',
                            'property' => 'border-bottom-color',
                        ),
                    ),
                ),

faptul ca primele doua array-uri din CSS se aplica pe acelasi property, callback-ul de JavaScript de la al doilea selector se aplica de fapt la primul

body, 
.entry-title a, 
.nav--toolbar a:before, 
.site-title a,
.widget a,
.comment__author-name a,
a:hover { color: rgba(255,255,255, 0.3); } 

configurarea asta e luata de la hive de pe branchul 185-style-manager

vladolaru commented 6 years ago

@razwan nush exact ce se intampla insa nu pot sa reproduc neam (pe Hive, cu configuratia respectiva). In frontend totul iese ok. Singura zona unde am gasit un bug (care nu stiu daca s-a manifestat pana acum) era legata de live preview-ul acelorasi proprietati pe aceeasi optiune din cauza faptului ca erau puse regulile de CSS (doar in Customizer) in