• Resolved philwiener

    (@philwiener)


    Hi there,

    let me fist say that I love your great plugin, it’s so useful! Especially the possibility for adding more CSS entries is perfect for me. I am definitely thinking about getting the pro version.

    I have a one question:
    Is it still necessary to mark some CSS as !important;?
    Or is the CSS from your plugin automatically !important; (overriding b.w. the theme’s CSS)?

    Best regards,
    Phil

    • This topic was modified 9 years, 3 months ago by philwiener.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    Hello Phil,

    the plugin doesn’t add !important to any rule. The plugin doesn’t modify at all the code you’re adding to the website. You are in full control of what shows up on your website.

    As you already know, the CSS rules are applied in the order they are read by the browser. The !important directive is there in order to enforce the rule, even if it might be overwritten later by another rule.

    A WordPress installation shows the CSS in the following order:
    1. Theme’s and plugins’ external stylesheets (intermixed)
    2. Other plugins’ internal CSS/JS and Simple Custom CSS and JS internal and external stylesheets (intermixed)
    3. CSS codes added with the theme’s Customizer

    Now, the answer to your question:
    – If you want to overwrite CSS added in a theme’s or a plugin’s external stylesheet, then you don’t need !important.
    – If you want to overwrite CSS added with the theme’s Customizer, you do need !important.
    – If you want to overwrite an internal CSS added by another plugin, it depends on the order in which the WordPress installation executes each plugin, so you might need !important.

    If you need to be reminded of the definitions for External, Internal and Inline CSS, here is a small tutorial.

    • This reply was modified 9 years, 3 months ago by SilkyPress.
    Thread Starter philwiener

    (@philwiener)

    Hey Diana,

    thanks a lot for the quick response – which is as perfect as your plugin. Benchmark!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘!important; – still needed’ is closed to new replies.