Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Remove non essential classes from core - the classes are in classy, cores templates should be as clean as possible.
js required classes should be prefixed to js- according to code standards
simpletest should be done with classy theme, not stark
Proposed resolution
See parent issue(s) and related issue(s) for details,
Twig Templates to modify:
- core/modules/system/templates/table.html.twig
- core/modules/system/templates/tablesort-indicator.html.twig
core/modules/system/templates/task-list.html.twig- core/modules/system/templates/textarea.html.twig
- core/modules/system/templates/time.html.twig
It appears task list no longer exists.
Remaining tasks
* test if resizable classes are essential
* test tablesort to still work
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#23 | table-before.png | 249.37 KB | rteijeiro |
#23 | table-after.png | 250.39 KB | rteijeiro |
#23 | form-before.png | 466.4 KB | rteijeiro |
#23 | form-after.png | 459.81 KB | rteijeiro |
#22 | t-templates-2.diff | 3.16 KB | mortendk |
Comments
Comment #1
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedComment #3
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedLine causing the test to fail is below,
$this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">Empty row.</td>', 'Colspan on #empty row found.');
Wondering if I should update the template file or test case.
Comment #4
davidhernandezPostponing this until we decide how we are moving forward. Keep an eye on #2348543: [meta] Consensus Banana Phase 2, transition templates to the starterkit theme for updates. Thanks.
Comment #5
davidhernandezUn-postponing. The templates have been copied to Classy, so all we need to do is remove classes from the original templates.
Comment #6
mortendk CreditAttribution: mortendk commentedwe need visual confirmation on resizable textareas still works without classes, else selector classes must be prefixed with
.js-
Comment #10
mortendk CreditAttribution: mortendk commentedComment #11
mortendk CreditAttribution: mortendk commentedComment #12
mortendk CreditAttribution: mortendk commentedComment #13
mortendk CreditAttribution: mortendk commentedComment #14
mortendk CreditAttribution: mortendk commentedComment #15
mortendk CreditAttribution: mortendk commentedfunction testThemeTableWithEmptyMessage() in tableTest.php needs to test on classy not on stark
Comment #16
mortendk CreditAttribution: mortendk commentedfixed the test
Comment #17
mortendk CreditAttribution: mortendk commentedComment #18
mortendk CreditAttribution: mortendk commentedscreenshots added of resize
Removed text-area class that was set from the module : housecleaning
Comment #20
mortendk CreditAttribution: mortendk commentedReuploaded patch from #16 - im an idiot so it was named as beeing F* templates, so lets try with the right letter
One issue:
.form-textarea
class is still added to the textarea, when using stark.Looks like it gets the name from
form.inc
Dunno why this is added but its there.
We could make a cowboy solution and use {{ attributes.removeClass('form-textarea') }} on the core template, but thats to ugly even for sloppy themers ;)
Anybody got a clue on why & where this comes from or should be make it into a followup issue & get the templates cleaned up now ?
Comment #22
mortendk CreditAttribution: mortendk commentedlets try thins again
Comment #23
rteijeiro CreditAttribution: rteijeiro commentedGood job, @mortendk! Yeah!
Table BEFORE
Table AFTER
Form BEFORE
Form AFTER
Comment #24
alexpottTemplates are not frozen in beta. Committed 275947d and pushed to 8.0.x. Thanks!