The Twig template for node.html.twig (and other templates) added default classes to these. We should do the same for taxonomy templates.
Suggestions include
.taxonomy-term
.taxonomy-term--vocabulary-name
.taxonomy-term--view-mode
.taxonomy-term--vocabulary-name--view-mode
Patch will be added to the comments.
Comment | File | Size | Author |
---|---|---|---|
#4 | classes-for-taxonomy-terms.jpg | 69.38 KB | markconroy |
#2 | core-taxonomy-add-classes-to-template-2767257-2-d8.patch | 667 bytes | markconroy |
Issue fork drupal-2767257
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
markconroy CreditAttribution: markconroy at Annertech for Limerick City & County Council commentedAdding patch, setting status to 'needs review'.
Comment #3
markconroy CreditAttribution: markconroy at Annertech for Limerick City & County Council commentedComment #4
markconroy CreditAttribution: markconroy at Annertech for Limerick City & County Council commentedComment #5
joelpittetWe tried hard to lighten the load of classes that are unneeded but give the flexibility to the frontend dev to add them back if they want to use them.
I don't think we should add them in, I do think you should if you want/need them for your project.
Maybe we can find a place to improve docs or make this easier for site builders?
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedPatches that add classes should really be against Classy, not templates in core modules etc (or Stable).
Note that Classy adds two classes already:
Comment #7
dawehnerJust a random idea, maybe having a test theme which has all kind of custom CSS classes, some using variables for example, might be a good place to give ideas for people?
Comment #9
lauriiiI have proposed adding unstable classy here: #2659890: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility which could include a unlimited amount of class changes, just like Bartik and Seven. It seems like it would help this issue.
Comment #14
andypostComment #23
shivam_tiwari CreditAttribution: shivam_tiwari at Atlas Softweb Pvt Ltd commentedComment #24
smustgrave CreditAttribution: smustgrave at Mobomo commentedClassy theme is removed in D10 and these changes probably appear in multiple locations.
Probably better to use a process hook to add the classes as editing a twig template will have to cover BC.
No test coverage either.