Problem/Motivation
In some cases it is necessary to use a certain heading's visual style but it is not possible to change the markup to use the correct element and it's styles.
For example displaying what is perceived as a h2 heading when you can only print a h3.
So it would be nice to have this possibility in the theme to achieve this with reusable heading classes.
Seven has already carried out this work here #2028053: Add typographic styles, components, and utility classes and explains the point of this very well. And we should use add this to Bartik too.
The work is needed for part of this issue.... #1768732: Wrong document outline because of Term reference label in h3.
The suggestion for this work is outlined in this Bartik issue... #2398445: Clean up the "elements" component in Bartik.
Proposed resolution
Add reusable heading classes to each heading element (h1, h2, h3 etc) declared in Bartik.
I suggest using the same style classes that Seven has, so .heading-a, heading-b etc. See here #2028053: Add typographic styles, components, and utility classes.
Remaining tasks
Write a patch,
Review the patch
Manual testing.
Add screenshots to show what the patch does visually.
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | interdiff-2400233-9-11.txt | 774 bytes | emma.maria |
| #11 | bartik-reuseable-header-classes-2400233-11.patch | 1.02 KB | emma.maria |
| #9 | interdiff.txt | 557 bytes | Katiemouse |
| #9 | 2400233-9-reusable-heading-classes.patch | 1.07 KB | Katiemouse |
Comments
Comment #1
lewisnymanAdded the same classes as Seven.
Comment #2
emma.mariaComment #3
emma.mariaSeven's classes are worded wrong so we need to add heading-a heading-b etc to the patch in this issue, I've also raised this issue for Seven :) #2402061: Reusable heading classes should be "heading-*" not "header-*".
Comment #4
rpayanmComment #5
lewisnymanLooks good to me, not much else to test here.
Comment #6
alexpottCan we add a comment about the fact that the heading-x classes are not used so that an eagle-eyed contributor does not remove them.
Comment #7
emma.mariaYes sure.
@LewisNyman you are better at technical wording so you should really draft the sentence but I have come up with...
"Heading-x classes are additional useful classes to be used in cases when you have to mimic the styles of a particular element for a different element."
If this is OK? I will add it to the patch.
Comment #8
alexpottLet's make it match whatever we add to #2402061: Reusable heading classes should be "heading-*" not "header-*"
Comment #9
Katiemouse commentedHi, I am in high school and new to drupal. I put up a patch for the other issue: #2402061: Reusable heading classes should be "heading-*" not "header-*" and was suggested to do the same for this one. My attempt is attached :)
Comment #10
lewisnymanCopying over the same feedback from: #2402061: Reusable heading classes should be "heading-*" not "header-*"
I am being picky but I would like to change the comment here. I think they will be used in the future so maybe we should just define their purpose instead of just that they aren't used.
How about:
"Reusable heading classes are included to help modules change the styling of headings on a page without affecting accessibility."
I don't think we need to link to the other issue.
Also, I've never seen us place a comment between selectors, can we put it above the h1, h2, h3 selectors please? Thanks!
Comment #11
emma.mariaThis issue hasn't been picked up in a while.
Here's the new patch as per instruction in #10. I have amended the comment content and moved the comment above the selectors plus added a space above the comment as per the CSS formatting standards.
Plus interdiff.
Comment #12
lewisnymanLooking goooood
Comment #13
alexpottCSS changes are permitted in beta. Committed 07b3f0a and pushed to 8.0.x. Thanks!