• Resolved Kevin

    (@killab)


    All the widgets in our sidebar display with text aligned right. When disabling atomic Blocks they return to the default left alignment. Upon inspecting the page the .right css class is being applied for some reason. The sidebar is on the right, so maybe this is why?

    We are up to date on WordPress (5.0.3) and are running X theme by Themeco.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Kevin

    (@killab)

    After further investigation, it seems the core of the issue is a namespace conflict with my theme. My theme uses a .right class for floating divs right. Atomic Blocks uses .right to align text right.

    Any easy way to fix this?

    Because AB’s styles are called after the theme’s styles, the page is going to default to whatever properties AB is using for that class name. The easiest way to override is to use a chained selector and use CSS’s cascading properties to override the AB selector.

    You would do this in your child theme’s styles.css file. Simply find where .right class is, then go in and right under it, use a parent element’s classname with the .right class and put in properties you want to use for that scenario.

    For example, say the body element has a class of ‘x-theme’ or some other arbitrary selector class name or ID. You can then use .x-theme .right {...} to override.

    If the selector using the .right class has another class name used w/ .right, you can just use that class directly prepended to the .right class. For example, .sidebar.right {...}.

    I do this all the time to override styles forced over my theme’s styles by plugins, auto-generated in the head, etc.

    Plugin Author atomicblocks

    (@atomicblocks)

    Hi there,

    As thoughtwell mentioned, you might try a more specific selector and undo the styles. I’ll see about making that .right class a little more specific to the plugin to prevent this from happening. Thanks for the heads up!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘All widgets have text-align: right applied’ is closed to new replies.