Remove default form style?

Remove default form style from the frontend.css file?

I’m loading a stylesheet and the frontent.css overwrites the css code

Hi salwebs,

it is unfortunately not possible to remove the default styles from the generated output (except doing it manually, but that doesn’t make any sense), because the frontend.min.css comes as is with Bricks and will not be generated on the fly.

You need to override the default styles with your custom styles within your stylesheet. Check form.min.css for all form element classes: wp-content/themes/bricks/assets/css/elements/form.min.css

Best regards,
timmse

Has anything changed in this regard?
Because I have the same problem with the tag, which gets the style from frontend.min.css and I can’t overwrite it.

best regards
Jacek

1 Like

SOLUTION 1: The easiest is to add the term [!important] in your CSS declarations, like this [border: 5px solid red !important;].

SOLUTION 2 : You need to enqueue your CSS stylesheet AFTER the [frontend.min.css] is enqueue itself. It’s called “dependency”. Example, my file [jy-color.css] must be enqueue after [frontend.min.css] to able to overwrite it. See code below.

SOLUTION 3 : Bricks developers simple need to add the term [where:] in front of all their CSS declarations to let users override them easily.
@BRICKS DEV => Maybe good to propose this as an option?

=== === ===
Here is the PHP code snippets. See how [$dependency] is added in the line [ wp_register_style]. That is what makes your CSS be loaded “after” [frontend.min.css], and so able to override it.

/*---------------------------

  1. Enqueue on [Wordpress Frontend] pages.
  2. Enqueue on [Wordpress Login] pages.
  3. Enqueue on [Wordpress Admin] pages.
    ---------------------------/
    /
    1 / add_action(‘wp_enqueue_scripts’, ‘jy_enqueue_css’);
    /
    2 / add_action(‘login_enqueue_scripts’, ‘jy_enqueue_css’);
    /
    3 */ add_action(‘admin_enqueue_scripts’, ‘jy_enqueue_css’);

function jy_enqueue_css() {
$folder = ‘/wp-content/uploads/css/’;
$file = ‘jy-color.css’;
$name = ‘jy-color’;
$dependency = array(‘bricks-frontend’); /* Dependency for the Bricks default stylesheet [frontend.min.css]. */
$url = get_home_url() . $folder . $file;
wp_register_style($name, $url, $dependency, ‘1.0’, ‘all’);
wp_enqueue_style($name);
}

=== === ===

2 Likes