pressbooks / pressbooks-aldine

Aldine is the default root theme for Pressbooks.
https://pressbooks.org/
GNU General Public License v3.0
11 stars 7 forks source link

Contact class lacks enough specificity #456

Open SteelWagstaff opened 3 months ago

SteelWagstaff commented 3 months ago

The CSS for Aldine has a rule that targets the .contact class in order to style the contact form designed to go on the home page: https://github.com/pressbooks/pressbooks-aldine/blob/47ec1854b7f6a23529be0329ac7dc24e0eeb709c/assets/styles/components/_forms.scss#L109-L117

If a user creates a page with the title (& permalink) of 'Contact' the body element for the page itself also receives a .contact class, resulting in flex styling and padding being applied to the page. It can be overridden, but a better solution would be to add additional specification to the .contact class designed to target just the contact form and not other elements which may happen to have this class applied. I recommend using #page

SteelWagstaff commented 3 months ago

@cmurtagh and @tw77 -- this came up in our support checkin today. I've submitted a PR that I think should fix it by adding an additional selector to the rule which targets the .contact class: https://github.com/pressbooks/pressbooks-aldine/pull/457. The CSS workaround was simply to apply something like:

body.contact {
    align-items: normal;
    padding: 0;
}