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.
Comment | File | Size | Author |
---|---|---|---|
#6 | radix-layouts-content-area-2656908-6.patch | 24.69 KB | mpotter |
#3 | radix-layouts-content-area-2656908-3.patch | 24.38 KB | mpotter |
#2 | radix-layouts-content-area-2656908-2.patch | 27.71 KB | mpotter |
Comments
Comment #2
mpotter CreditAttribution: mpotter commentedNote 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.
Comment #3
mpotter CreditAttribution: mpotter commentedHere is an updated patch used in Atrium that fixes the new content region classes for several layouts.
Comment #4
shadcn CreditAttribution: shadcn at Chapter Three commentedThis looks good. Tested.
Comment #5
shadcn CreditAttribution: shadcn at Chapter Three commentedComment #6
mpotter CreditAttribution: mpotter commentedMinor update to sutro-double middle region.
Comment #8
shadcn CreditAttribution: shadcn at Chapter Three commentedLooks good. Committed. Thanks Mike.
Comment #9
shadcn CreditAttribution: shadcn at Chapter Three commented