When trying to apply some consistent theming for background colors and spacing across many different radix layouts, I have found the need for more consistent identification of the header, content, sidebar, and footer regions.

If the specific layout has a region with the correct name then these classes get added. However, when layouts are more complex, these classes are omitted because they are not needed to reference the specific layout name.

However, having these classes, even if they don't match a region name, is still very useful from a theming perspective. For example, if I always want my main content area to have a certain background, I don't care if that content area actually has multiple columns. I still want to be able to target the parent container.

In most cases this just required adding classes to parent containers.

However, in some cases it required adding additional wrappers in order to wrap these areas.

Not sure if people will agree with this method or not. Maybe there is a better way. But when creating some general theme rules for Open Atrium I wanted to get rid of all the ugly CSS selectors that were targeting specific layout names. Now I can target .radix-layouts-content > .panel-panel-inner and know that it will always mark the main content area of the site even if that is split into finer columns and rows.

Note that not all layouts got changed. Some of the layouts just don't have an obvious content area, which is fine.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mpotter created an issue. See original summary.

mpotter’s picture

Status: Active » Needs review
FileSize
27.71 KB

Note that the white-space changes from indenting make this patch look much worse than it is. Apply the patch and then do a "git diff -w" to see the real changes.

mpotter’s picture

Here is an updated patch used in Atrium that fixes the new content region classes for several layouts.

shadcn’s picture

Status: Needs review » Reviewed & tested by the community

This looks good. Tested.

shadcn’s picture

mpotter’s picture

Minor update to sutro-double middle region.

  • arshadcn committed 4a44953 on 7.x-3.x authored by mpotter
    Issue #2656908 by mpotter, arshadcn: Adding consistent header, content,...
shadcn’s picture

Looks good. Committed. Thanks Mike.

shadcn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.