Problem/Motivation

See: #2489460: [Meta] Move module.theme.css files to Classy or Seven

Proposed resolution

Move the CSS file to classy
Create a library for the CSS file
Add the library in the Classy twig template

Remaining tasks

  • Add screenshots.

User interface changes

None for Classy, Stark will be more Stark

API changes

None

Stark:

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because theme system standards
Issue priority Not critical because theme standards
Unfrozen changes Unfrozen because it only changes CSS

Classy:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mortendk’s picture

Manjit.Singh’s picture

Status: Active » Needs review
FileSize
2.17 KB

Moving comment css file to classy

LewisNyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/classy/classy.libraries.yml
@@ -3,3 +3,9 @@ base:
+comment-threaded:
+  version: VERSION
+  css:
+    theme:
+      css/comment/comment.theme.css: {}
\ No newline at end of file

We need a newline at the end of this file

We still need to remove the reference to the removed library here:

core/modules/comment/src/CommentViewBuilder.php:
  184        // Add indentation div or close open divs as needed.
  185        if ($build['#comment_threaded']) {
  186:         $build['#attached']['library'][] = 'comment/drupal.comment.threaded';
  187          $prefix .= $build['#comment_indent'] <= 0 ? str_repeat('</div>', abs($build['#comment_indent'])) : "\n" . '<div class="indented">';
  188        }

It also looks like we still have the indented classes here that should be in classy?

Manjit.Singh’s picture

Done with the changes mentioned in #3. Please verify.

Manjit.Singh’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Issue tags: +Needs screenshots

Nice, thanks. I think we need before/after screenshots of Classy.

sqndr’s picture

Issue tags: +Novice

Added novice tag.

sqndr’s picture

Issue summary: View changes
lauriii’s picture

Status: Needs review » Needs work

Needs work for needs tag

Manjit.Singh’s picture

CSS file is not calling in classy :(

comments-before-applying-patch.png

comments-after-applying-patch.png

Manjit.Singh’s picture

Based on the discussion at #2489460: [Meta] Move module.theme.css files to Classy, at this point library names in Classy should match what is in the core module. So, comment-threaded should be drupal.comment.threaded.

Manjit.Singh’s picture

Status: Needs work » Needs review
Issue tags: -Needs screenshots, -Novice
LewisNyman’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
757.09 KB
695.71 KB

I tested thread comments in both Stark and Classy and I can confirm that the comments indent in Classy but no longer indent in Stark. Thanks!

Stark:

Classy:

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Bartik overrides comment.html.twig so comment.theme.css won't be attached for Bartik.

mortendk’s picture

Status: Needs work » Needs review
FileSize
2.59 KB

rerolled the patch so it adds in the library again

but we have a problem with attach_library as in bartik adding in {{ attach_library('classy/drupal.comment.threaded') }} dont attach the file neither does {{ attach_library('@classy/drupal.comment.threaded') }}
So how do we add from another lib ?

star-szr’s picture

FileSize
114.46 KB

@mortendk seems fine here. I cleared caches and made a comment on a node and viewed that node:

star-szr’s picture

Would be nice to only attach when threaded though, that's what the logic before was doing…

mortendk’s picture

oki well then i guess its ready to roll ;)
... me wonders wtf is up in my build

star-szr’s picture

Implemented #17.

mortendk’s picture

Status: Needs review » Reviewed & tested by the community

good call on the variable set - comment.theme.css now only added if comments actually exist & in bartik as well

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

The is a non disruptive CSS change. Committed ae86ffd and pushed to 8.0.x. Thanks!

Can the meta issue have the proper beta evaluation added - thanks.

  • alexpott committed ae86ffd on 8.0.x
    Issue #2489560 by Manjit.Singh, Cottser, mortendk, LewisNyman: move...
LewisNyman’s picture

Issue summary: View changes

Evaluation added.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.