Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Oct 2014 at 12:34 UTC
Updated:
17 Feb 2015 at 15:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lauriiiComment #3
davidhernandezPlease double-check if any removed classes are being used in javascript. It is best to test the affected template using Stark to make sure nothing is broken.
Comment #4
manuel garcia commentedApplied the patch and did some searching on the removed classes inside /core. I only mention here the ones that came up with some results that might need attention. None of the classes turned up on any JS file.
node-type-list
Used in
core/modules/block_content/templates/block-content-add-list.html.twiglayout-node-form
found in
core/themes/seven/css/layout/node-add.css:layout-region
Used in
core/modules/block/css/block.admin.cssandcore/modules/node/css/node.module.csslayout-region-node-secondary
In
core/modules/node/css/node.module.cssandcore/themes/seven/css/layout/node-add.csslayout-region-node-footer
In
core/modules/node/css/node.module.css.node--unpublished
In
core/modules/system/css/system.theme.cssComment #5
rteijeiro commentedTrying to fix tests.
Comment #6
davidhernandezI believe all the failing tests are fixed by this issue. #2350823: Use the Classy theme in the Testing profile
Comment #8
lauriiiNo need to fix tests
Comment #9
wheatpenny commentedBelow is the list of removed classes:
node-type-list
layout-node-form
clearfix
layout-region
layout-region-node-main
layout-region-node-secondary
layout-region-node-footer
node
node--type-*
node--promoted
node--sticky
node--unpublished
node--view-mode-*
node__meta
node__submitted
node__content
node__links
I found the same results as @Manuel Garcia. Except for "node--unpublished," the CSS for the other classes deals with layout and is not functional.
However, for "node--unpublished," that CSS is the background color on nodes to indicate that they are unpublished. I'm not convinced that this class is necessary, but I can see the argument that it's functional. We'll need to decide if that class name remains in the module template.
Finally, I noticed when "node.html.twig" was copied to Classy, the following were removed:
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - content_attributes: Same as attributes, except applied to the main
* content tag that appears in the template.
* - author_attributes: Same as attributes, except applied to the author of
* the node tag that appears in the template.
and the following was added:
* - is_front: Flag for front. Will be true when presented on the front page.
I wanted to bring this up in case we need to add the _attributes comments back. Also, are we adding "is_front" to node.html.twig?
TO DO:
1. Copy the following templates to Classy:
core/modules/node/templates/field--node--created.html.twig
core/modules/node/templates/field--node--title.html.twig
core/modules/node/templates/field--node--uid.html.twig
Comment #10
wheatpenny commentedComment #11
lauriiiSo is there any CSS or JS attached to
.node--unpublishedin core? I think we could remove it because it's not functionality everyone wants to have I guess.Comment #12
manuel garcia commentedPlaces in CSS where you find
.node--unpublished:core/modules/system/css/system.theme.css Line 9:
core/themes/bartik/css/style.css line 852:
core/themes/bartik/css/style.css line 856:
The class isn't used on any JS file in core.
Comment #13
davidhernandez.node-unpublished is used to add that pink background color you see when a node is unpublished. It is style, but I understand the argument that it is functional. This is a similar discussion we've been having about the color striping of the update pages. Should someone using Stark still get the visual cue. I don't mind leaving it in.
Comment #14
wheatpenny commentedThis looks like a good novice issue, so I'm going to write up next steps:
1. Copy (but do not delete)
core/modules/node/templates/field--node--created.html.twig
core/modules/node/templates/field--node--title.html.twig
core/modules/node/templates/field--node--uid.html.twig
to
core/themes/classy/templates/field--node--created.html.twig
core/themes/classy/templates/field--node--title.html.twig
core/themes/classy/templates/field--node--uid.html.twig
2. In core/modules/node/templates/node.html.twig, add the following above "article:"
3. In core/modules/node/templates/node.html.twig, change
<article{{ attributes }}>to<article{{ attributes.addClass(classes) }}>Comment #15
preshetin commentedHere I tried to implement #14 instructions.
In this patch I only copied three .twig files (Step 1). As for changing core/modules/node/templates/node.html.twig I was confused. As I understand, the necessary changes already exist:
Comment #16
preshetin commentedComment #17
wheatpenny commentedThanks, @preshetin! What you'll need to do is apply the patch from #1, make the changes listed in #14, and then make a new patch. There are good resources (https://www.drupal.org/patch), but you should also feel free to reach out to me, and I'll help walk you through the steps. Also, feel free to stop by #drupal-contribute or #drupal-twig in IRC (https://www.drupal.org/irc) for assistance.
Comment #18
preshetin commented@wheatpenny, thank you for review. Here is how it looks now.
If anything is still wrong, please specify.
Comment #19
lauriiiWe could also remove the set and addClass
Comment #20
lauriiiComment #23
wheatpenny commentedThanks @laurii. Based on comment #13, shouldn't we add set and addClass back to /core/modules/node/templates/node.html.twig? My understanding is that we want to make the class "node--unpublished" available in Stark.
Comment #25
lewisnymanIf it is required for functionality then we are communicating on color alone which is against our accessibility standards. I would rather move the styling out of Stark and communicate this in plain text.
Comment #26
wheatpenny commentedYes, we are communicating the the node's "unpublished" state through color only. Below is an unpublished node.

Comment #27
wheatpenny commentedThere is an existing issue that is working on improving the "unpublished" state: https://www.drupal.org/node/867830
Comment #28
mortendk commentedplease lets keep these patches to only focus on moving to classy, if theres other work that needs to get done, then create a followup issue
Comment #29
alexpottAre not copied and they are missing classes.
Comment #30
mortendk commentedI need new glasses, wonder how i missed that heres a reroll with the attributes still there in core but classes moved out.
Comment #31
manuel garcia commentedPatch works and reads great. Tested it on a clean install, everything is as it was.
Comment #32
Jeff Burnz commented#25 see this #867830: "Unpublished" style of rendered entities is not accessible (and looks bad)
Comment #33
alexpottCSS and templates are not subject to beta evaluation. Committed ebea5b8 and pushed to 8.0.x. Thanks!