This repository was archived by the owner on Dec 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
sample/sections/color-selection Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,13 @@ public function output( $style = '' ) {
259259 $ this ->field ['compiler ' ] = array ( $ this ->field ['compiler ' ] );
260260 }
261261
262+ if ( isset ( $ this ->field ['compiler ' ]['important ' ] ) ) {
263+ if ( $ this ->field ['compiler ' ]['important ' ] ) {
264+ $ style = str_replace ( '; ' , ' !important; ' , $ style );
265+ }
266+ unset( $ this ->field ['compiler ' ]['important ' ] );
267+ }
268+
262269 if ( ! empty ( $ this ->field ['compiler ' ] ) && is_array ( $ this ->field ['compiler ' ] ) ) {
263270 $ keys = implode ( ', ' , $ this ->field ['compiler ' ] );
264271 $ this ->parent ->compilerCSS .= $ keys . '{ ' . $ style . '} ' ;
Original file line number Diff line number Diff line change @@ -272,6 +272,13 @@ public function output( $style = '' ) {
272272 if ( ! empty ( $ this ->field ['output ' ] ) && is_array ( $ this ->field ['output ' ] ) ) {
273273 $ style_string = '' ;
274274
275+ if ( isset ( $ this ->field ['output ' ]['important ' ] ) ) {
276+ if ( $ this ->field ['output ' ]['important ' ] ) {
277+ $ style = str_replace ( '; ' , ' !important; ' , $ style );
278+ }
279+ unset( $ this ->field ['output ' ]['important ' ] );
280+ }
281+
275282 foreach ( $ style as $ key => $ value ) {
276283 if ( is_numeric ( $ key ) ) {
277284 $ style_string .= implode ( ', ' , $ this ->field ['output ' ] ) . '{ ' . $ value . '} ' ;
@@ -316,6 +323,13 @@ public function output( $style = '' ) {
316323 if ( ! empty ( $ this ->field ['compiler ' ] ) && is_array ( $ this ->field ['compiler ' ] ) ) {
317324 $ style_string = '' ;
318325
326+ if ( isset ( $ this ->field ['compiler ' ]['important ' ] ) ) {
327+ if ( $ this ->field ['compiler ' ]['important ' ] ) {
328+ $ style = str_replace ( '; ' , ' !important; ' , $ style );
329+ }
330+ unset( $ this ->field ['compiler ' ]['important ' ] );
331+ }
332+
319333 foreach ( $ style as $ key => $ value ) {
320334 if ( is_numeric ( $ key ) ) {
321335 $ style_string .= implode ( ', ' , $ this ->field ['compiler ' ] ) . '{ ' . $ value . '} ' ;
Original file line number Diff line number Diff line change 2727 'hover ' => '#bbb ' ,
2828 'active ' => '#ccc ' ,
2929 ),
30- 'output ' => 'a ' ,
30+ 'output ' => array (
31+ 'a ' ,
32+ 'important ' => true ,
33+ ),
3134
3235 // phpcs:ignore Squiz.PHP.CommentedOutCode
3336 // 'regular' => false, // Disable Regular Color.
You can’t perform that action at this time.
0 commit comments