Problem/Motivation

Our CSS standards recommend that CSS is split up into smaller files inline with these categories:

  • Base
  • Layout
  • Component
  • Theme

Explanations of what each file contains can be found here.

Proposed resolution

Let's split up Bartik's style.css into these categories, just like we did with the Seven theme. Let's not fix any problems we see while moving files, just shift the CSS as it is into whichever file it fits into.

Remaining tasks

  1. Write a patch.
  2. Make sure the legacy color module doesn't break, see #2.
  3. Fix the CssCollectionGrouperUnitTest.php (tests/Drupal/Tests/Asset/CssCollectionGrouperUnitTest.php).
  4. Review the patch (code). Keep in mind that you should have some knowledge about SMACSS in order to review this patch. Are the files separated correctly?
  5. Manually review the patch. Does everything look the same when the patch is applied, since only files are moved?
    Test scenario: Standard install, with 2 nodes (Foo and Bar), each shown in the main menu, with Bar being a child of Foo. Also a custom block.
    Compare the following with Phantom CSS, and manually when using contextual links
    1. /
    2. /user/login
    3. /user/register
    4. /user/1
    5. /node/1 - Article node
    6. /node/2 - Basic page node
    7. /contact
    8. /search/node
    9. /search/user?keys=admin

    Finally, also test with Color module.

  6. RTBC!

User interface changes

None

API changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Tasks because currently Bartik is not inline with our own coding standards. We did the same thing for Seven.
Issue priority Important because this is part of #2372045: [META] The plan for Bartik which tries to make Bartik a better theme for front-end developers. It's a blocker for getting other (css) issues fixed.
Unfrozen changes Unfrozen because it only changes the Bartik theme css file structure.
Prioritized changes The main goal of this issue is getting Bartik compatible with our css file organisation coding standards.
CommentFileSizeAuthor
#128 Create_Article___drupal8_dev.png619.12 KBlewisnyman
#125 Screen Shot 2014-12-13 at 1.04.48 PM.png126.41 KBlauriii
#118 split_bartik_c_css_into-2375673-118.patch121.06 KBlauriii
#118 interdiff.txt51.17 KBlauriii
#116 split_bartik_c_css_into-2375673-116.patch71.08 KBlauriii
#110 split_bartik_c_css_into-2375673-110.patch121.02 KBlewisnyman
#110 interdiff.txt1.37 KBlewisnyman
#109 Screen Shot 2014-12-09 at 1.30.36 AM.png212.13 KBlauriii
#108 split_bartik_c_css_into-2375673-108.patch120.67 KBlewisnyman
#108 interdiff.txt3.67 KBlewisnyman
#106 after-patch-dropdowns.png98.34 KBemma.maria
#106 after-patch-dropdowns-mobile.png309.96 KBemma.maria
#106 after-patch-desktop-dropdowns.png171.31 KBemma.maria
#106 sidebar-before-patch.png164.47 KBemma.maria
#106 sidebar-after-patch.png182.83 KBemma.maria
#106 article-page-mobile.png388.72 KBemma.maria
#106 article-page-desktop.png207.17 KBemma.maria
#105 interdiff-2375673-102-105.txt595 bytesDickJohnson
#105 split_bartik_c_css_into-2375673-105.patch120.44 KBDickJohnson
#102 interdiff-2375673-94-102.txt534 bytesDickJohnson
#102 split_bartik_c_css_into-2375673-102.patch120.17 KBDickJohnson
#100 Screen Shot 2014-12-06 at 11.54.32.jpg236.23 KBlewisnyman
#100 Screen Shot 2014-12-06 at 11.54.19.jpg473.29 KBlewisnyman
#100 Screen Shot 2014-12-06 at 11.53.25.jpg373.99 KBlewisnyman
#100 backstop.json_.txt2.01 KBlewisnyman
#98 bartik-test-after-patch.png132.15 KBDickJohnson
#94 split_bartik_c_css_into-2375673-94.patch120.16 KBlewisnyman
#94 interdiff.txt691 byteslewisnyman
#92 split_bartik_c_css_into-2375673-92.patch120.56 KBlewisnyman
#92 interdiff.txt2.26 KBlewisnyman
#90 Screen Shot 2014-12-05 at 10.24.27.png126.02 KBwim leers
#89 split_bartik_c_css_into-2375673-89.patch120.75 KBlauriii
#88 split_bartik_c_css_into-2375673-88.patch70.82 KBlauriii
#86 interdiff.txt833 byteslauriii
#86 split_bartik_c_css_into-2375673-86.patch121.23 KBlauriii
#84 split_bartik_c_css_into-2375673-84.patch121.32 KBlewisnyman
#81 split_bartik_c_css_into-2375673-81.patch136.24 KBDickJohnson
#81 interdiff-2375673-79-81.txt1.53 KBDickJohnson
#79 interdiff-2375673-75-79.txt1.62 KBDickJohnson
#79 split_bartik_c_css_into-2375673-79.patch134.91 KBDickJohnson
#76 interdiff-2375673-73-75.txt1.81 KBDickJohnson
#76 split_bartik_c_css_into-2375673-75.patch136.28 KBDickJohnson
#73 interdiff-2375673-69-73.txt10.93 KBDickJohnson
#73 split_bartik_c_css_into-2375673-73.patch134.79 KBDickJohnson
#70 Screen Shot 2014-11-25 at 9.02.01 PM.png267.14 KBlauriii
#69 split_bartik_c_css_into-2375673-69.patch136.2 KBDickJohnson
#69 interdiff-2375673-67-69.txt670 bytesDickJohnson
#67 interdiff-2375673-44-67.txt3.79 KBDickJohnson
#67 split_bartik_c_css_into-2375673-67.patch136.33 KBDickJohnson
#64 suggested_interdiff.txt2.74 KBwim leers
#58 split_bartik_c_css_into-2375673-57.patch134.43 KBDickJohnson
#58 interdiff-2375673-53-57.txt18.04 KBDickJohnson
#53 Screen Shot 2014-11-25 at 11.00.36 AM.png103.53 KBlauriii
#53 split_bartik_c_css_into-2375673-53.patch118.68 KBlauriii
#53 interdiff.txt17.11 KBlauriii
#51 interdiff-2375673-48-51.txt17.99 KBDickJohnson
#51 split_bartik_c_css_into-2375673-51.patch133.7 KBDickJohnson
#49 split_bartik_c_css_into-2375673-48.patch117.72 KBlewisnyman
#49 interdiff.txt809 byteslewisnyman
#45 split_bartik_c_css_into-2375673-44_0.patch133.52 KBDickJohnson
#40 split_bartik_c_css_into-2375673-39_0.patch128.67 KBDickJohnson
#37 split_bartik_c_css_into-2375673-37_0.patch128.65 KBDickJohnson
#36 Screen Shot 2014-11-23 at 12.14.57 PM.png352.79 KBlauriii
#36 Screen Shot 2014-11-23 at 12.15.32 PM.png345.88 KBlauriii
#31 split_bartik_c_css_into-2375673-31_0.patch128.62 KBDickJohnson
#28 split_bartik_c_css_into-2375673-28_0.patch125.05 KBDickJohnson
#27 split_bartik_c_css_into-2375673-27_0.patch119.85 KBDickJohnson
#24 split_bartik_s_css_into-2375673-24.patch120.82 KBDickJohnson
#22 split_bartik_s_css_into-2375673-22.patch118.52 KBDickJohnson
#12 split_bartik_s_css_into-2375673-12.patch129.15 KBsqndr
#9 split_bartik_s_css_into-2375673-9.patch18.96 KBstephr
#4 split_bartik_s_css_into-2375673-4.patch125.08 KBsqndr

Comments

davidhernandez’s picture

Let's not fix any problems we fix while moving files.

Is this a typo? Does it mean "not fix any problems we see..." ?

jensimmons’s picture

I just want to reiterate for anyone new, the CSS which handles colors that can be changed by Color module need to be in a separate style sheet — the way it's structured in Bartik for D7. This will be a deviation from the core OCSS plan, but it's needed to prevent much head banging. I went into much more detail about why here: https://www.drupal.org/node/2372045#comment-9338781

sqndr’s picture

Issue summary: View changes
sqndr’s picture

Issue summary: View changes
StatusFileSize
new125.08 KB

If we add some documentation to the file, with some of the historical background that you've provided, it wouldn't be a problem that these rules live inside a separate stylesheet. I feel like it some way it would make sense, since it's a "component" of it's own.

Currently I've created a patch that does the basic magic. I've basically been splitting up into separate files based on the comments. It's in no way done yet. The are still some base elements in the components, the media queries are in a separate file, … There's more work to do!

I found a test that uses the style.css. We'll have to fix this test as well when moving files.

With the changes I've made here, the color module seems to continue to work just fine.

lauriii’s picture

Status: Active » Needs review

Putting to Needs review to see failing tests

Status: Needs review » Needs work

The last submitted patch, 4: split_bartik_s_css_into-2375673-4.patch, failed testing.

lauriii’s picture

Issue tags: +Needs reroll
sqndr’s picture

I'll work some on this issue later today.

stephr’s picture

Status: Needs work » Needs review
StatusFileSize
new18.96 KB

Worked on this issue on the DrupalCamp Gothenburg Sprint Day. (Re)Created files, directories, and moved files and content according to https://www.drupal.org/files/issues/split_bartik_s_css_into-2375673-4.patch up until line 496 (breadcrumb.css created, Breadcrumbs css content added).

Found some issues, e.g. with a missing book.css file that was not added to bartik.libraries.yml file, which I fixed.

Pls feel free to pick this up and continue work on it.

Drupal 8 commit version was:

commit 1397bd65bc2614287621622b113396593333813c
Author: Nathaniel Catchpole

Status: Needs review » Needs work

The last submitted patch, 9: split_bartik_s_css_into-2375673-9.patch, failed testing.

sqndr’s picture

@stephr: Please make sure to not work on issues that are assigned to someone, especially if they commented that they're working on it. If the issue is assigned to someone and the last update was more than a week ago, ask first if it's okay to work on the issue. ;)

sqndr’s picture

StatusFileSize
new129.15 KB

Another patch, that fixes most of the file movements + fixes some comments and tests that refer to the old css/style.css file.

Changing to needs review to run the tests on testbot. If everything goes well, only one test should fail. Fingers crossed!

sqndr’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: split_bartik_s_css_into-2375673-12.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: split_bartik_s_css_into-2375673-12.patch, failed testing.

sqndr’s picture

+++ b/core/lib/Drupal/Core/Extension/ThemeHandlerInterface.php
@@ -59,8 +59,8 @@ public function uninstall(array $theme_list);
+   *     (e.g. elements.css). The value is a complete filepath (e.g.
+   *     themes/bartik/elements.css). Not set if no stylesheets are defined in the

Need to fix this comment.

sqndr’s picture

Assigned: sqndr » Unassigned
Jeff Burnz’s picture

Color module can rewrite an array of stylesheets, so that could be SMACCified also if we wanted to go that far.

DickJohnson’s picture

Assigned: Unassigned » DickJohnson

Working on this today 22.11.14 on finnish Drupal user groups sprint. Assigned to myself.

emma.maria’s picture

Issue summary: View changes
DickJohnson’s picture

StatusFileSize
new118.52 KB

Did a manual reroll for patch as some css had changed. It would be very good not to make the changes before split is done. I have a backup of style.css before the change and I'm going to add it to next message tomorrow morning.

Didn't touch the tests. Just made a split for css's.

lauriii’s picture

Status: Needs work » Needs review

Putting to needs review to see what testbot has to say

DickJohnson’s picture

StatusFileSize
new120.82 KB

Last patch lacked few things f.ex bartik.libraries.yml file. Also added few tests.

The last submitted patch, 22: split_bartik_s_css_into-2375673-22.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 24: split_bartik_s_css_into-2375673-24.patch, failed testing.

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new119.85 KB

Tried to fix the tests.

DickJohnson’s picture

StatusFileSize
new125.05 KB

While looking into split with fresh pair of eyes around we made a notice that even stuff from layout.css was moved to layout/layout.css the ole layout.css was still around. We also found an failure from CssCollectionGrouperUnitTest as elements.css had wrong basename.

I didn't touch the file print.css -file as I think it should be handled separately. Another completely wrongly being thing is the components/media.css but also for that I think that best way to handle it is after the smaccsifying has been done and separately to this issue.

The last submitted patch, 27: split_bartik_c_css_into-2375673-27_0.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 28: split_bartik_c_css_into-2375673-28_0.patch, failed testing.

DickJohnson’s picture

StatusFileSize
new128.62 KB

Fixed the taxonomy and menu tests. Should be one failure left.

DickJohnson’s picture

Status: Needs work » Needs review

To get testbot stuff.

lauriii’s picture

Issue tags: -Needs reroll

Status: Needs review » Needs work

The last submitted patch, 31: split_bartik_c_css_into-2375673-31_0.patch, failed testing.

lauriii’s picture

We need the beta evaluation block to the issue summary

lauriii’s picture

We still have some visual changes on the layout

Before:

After:

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new128.65 KB

Typo on buttons.css on bartik.libraries.yml. Fixed it.

DickJohnson’s picture

Assigned: DickJohnson » Unassigned
lauriii’s picture

Problem with the sidebars is that it color.css sets color for the borders but its being overrided on the sidebar.css with border: 1px solid;. We could use border-width: 1px; border-style: solid; in the sidebar.css to avoid this problem.

DickJohnson’s picture

StatusFileSize
new128.67 KB

Fixed the broken border.

The last submitted patch, 37: split_bartik_c_css_into-2375673-37_0.patch, failed testing.

lewisnyman’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/bartik/bartik.libraries.yml
    @@ -2,9 +2,45 @@ base:
    +      # Todo, remove media-queries to correct files
    +      css/components/media.css: {}
    ...
    +      # Todo remove print css
           css/print.css: { media: print }
    

    I don't think we should have todo's in this file, let's just create follow up issues. Also should we be removing the print css? Is there an issue for that?

  2. +++ b/core/themes/bartik/bartik.libraries.yml
    @@ -2,9 +2,45 @@ base:
    +      # Theme
    +      css/theme/maintenance-page.css: {}
    

    We are also loading this css file unnecessarily, as it is being loaded in it's own library below. We should update the page for that css file

  1. +++ b/core/themes/bartik/css/components/breadcrumb.css
    @@ -0,0 +1,5 @@
    +.breadcrumb {
    +  font-size: 0.929em;
    +}
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/captions.css
    @@ -0,0 +1,31 @@
    +[dir="rtl"] .caption-blockquote > figcaption {
    +  text-align: right;
    +}
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/featured.css
    @@ -0,0 +1,22 @@
    +#featured p {
    +  margin: 0;
    +  padding: 0;
    +}
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/highlighted.css
    @@ -0,0 +1,6 @@
    +#highlighted {
    +  border-bottom: 1px solid #d3d7d9;
    +  font-size: 120%;
    +}
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/messages.css
    @@ -0,0 +1,17 @@
    +[dir="rtl"] div.messages {
    +  margin-right: 23px;
    +  margin-left: 15px;
    +}
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/shortcut.css
    @@ -0,0 +1,15 @@
    +div.add-or-remove-shortcuts {
    +  padding-top: 0.9em;
    +}
    \ No newline at end of file
    

    Missing new lines at the end of files

  2. +++ b/core/themes/bartik/css/components/content.css
    @@ -0,0 +1,177 @@
    +/* ----------------- Content ------------------ */
    +
    

    Content seems like a very generic name for a file. It looks like a lot of the classes in here are to do with nodes. So node.css might be a good idea.

    There are also a lot of field CSS so maybe we should move them to field.css?

    node-preview should go into it's own CSS file that that is it's own component.

  3. +++ b/core/themes/bartik/css/components/header.css
    @@ -0,0 +1,222 @@
    +/* ------------------ Header ------------------ */
    +.skip-link,
    +.skip-link.visually-hidden.focusable {
    

    Skip link should go into it's own file.

  4. +++ b/core/themes/bartik/css/components/list.css
    @@ -0,0 +1,67 @@
    +.pager .pager__items {
    +  padding: 0;
    +}
    +.pager__item {
    +  font-size: 0.929em;
    +  padding: 10px 15px;
    +}
    

    pager styles should go into their own CSS file

  5. +++ b/core/themes/bartik/css/components/list.css
    @@ -0,0 +1,67 @@
    +ul.tips {
    +  padding: 0 0 0 1.25em; /* LTR */
    +}
    

    tips look like it's own component as well

  6. +++ b/core/themes/bartik/css/components/main.css
    @@ -0,0 +1,6 @@
    +/* ------------------- Main ------------------- */
    +
    +#main {
    +  margin-top: 20px;
    +  margin-bottom: 40px;
    +}
    

    Maybe this can just go into layout.css?

  7. +++ b/core/themes/bartik/css/components/search.css
    @@ -0,0 +1,71 @@
    +/* --------------- Search Results ---------------- */
    +ol.search-results {
    +  padding-left: 0;
    +  list-style-position: inside;
    +}
    

    Can we split up search form and search results into separate files? They are separate components

  8. +++ b/core/themes/bartik/css/components/tabs.css
    @@ -0,0 +1,157 @@
    +/* ------------------ Reset Styles ------------------ */
    +
    +blockquote {
    

    Looks like this styling should go into base/elements.css?

  9. +++ b/core/themes/bartik/css/components/views.css
    --- /dev/null
    +++ b/core/themes/bartik/css/hacks.css
    
    +++ b/core/themes/bartik/css/hacks.css
    +++ b/core/themes/bartik/css/hacks.css
    @@ -0,0 +1,15 @@
    
    @@ -0,0 +1,15 @@
    +/* -------------- Other Overrides ------------- */
    +
    +div.password-suggestions {
    +  border: 0;
    +}
    

    Can we not have a hacks file please? Can we move these styles into meaningful file name? Maybe user.css/forum.css/contextual.css?

lauriii’s picture

Thanks for working on this issue @DickJohnson! To make reviewing easier next time you should create interdiff.

The last submitted patch, 40: split_bartik_c_css_into-2375673-39_0.patch, failed testing.

DickJohnson’s picture

StatusFileSize
new133.52 KB

Fixed the problems on coding standards. Fixed bartik.libraries.yml for all parts reported. Got rid of main.css, made a set of new files to components. Thanks for tip on interdiff, going to create that kind of thing next time I'll make a patch.

I left few unwanted files like hacks.css and media.css around as those are mostly the kind of things we should get rid of when doing more refactoring & recoding of bartik. On this issue the importantest thing was the split. Still, if you want to name hacks.css as common.css or contextual.css or whatever we can do it.

DickJohnson’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 45: split_bartik_c_css_into-2375673-44_0.patch, failed testing.

DickJohnson’s picture

StatusFileSize
new12.06 KB

Added interdiff for last two patches.

lewisnyman’s picture

Status: Needs work » Needs review
StatusFileSize
new809 bytes
new117.72 KB

I've been trying to figured out why the patch is failing. I've narrowed it down to some change in the libraries file. If I delete the last 10 css files from the libraries.yml file then the test seems to pass. I have no idea why. See the interdiff

sqndr’s picture

Status: Needs review » Needs work

Changing back to Needs work because of #49. The test now passes, but not all the files are included. Let's figure out why!

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new133.7 KB
new17.99 KB

After talking with @lewisnyman we decided to try different kind of setup on bartik.libraries.yml to see what happens.

sqndr’s picture

Seems like testbot like the patch now. Any idea why it works now? Great work! If #2377397: Themes should use libraries, not individual stylesheets gets committed first, it will also rename the tag in the info file. We would also ask there to no touch Bartik and fix it in this issue, to make sure we don't break each others work.

lauriii’s picture

Status: Needs review » Needs work
StatusFileSize
new17.11 KB
new118.68 KB
new103.53 KB

@sqndr: The problem we had there was really tricky. When I looked it I couldn't find any connection between the failing test and this patch. Both ways CSS files were loaded and visually everything was good. Any how this fixes the test.

Libraries were not attached on the info file so they were not loaded anywhere. I added them to the info file and I see something like this so this still needs work:

lauriii’s picture

Status: Needs work » Needs review

Putting still to needs review for testbot

Status: Needs review » Needs work

The last submitted patch, 53: split_bartik_c_css_into-2375673-53.patch, failed testing.

DickJohnson’s picture

Ok, so my first test went well because the css-files weren't actually added because of lackness of css/components on bartik.info.yml. Now the issue is being "fixed" (read: not getting failure from testbot) if you drop any 6 css files from components on bartik.libraries.yml. So it looks like there somekind of limit for 26 files on one tree in yml file. Makes no sense.

fabianx’s picture

Assigned: Unassigned » wim leers

Assigning to Wim, that is his specialty :)

DickJohnson’s picture

And as a proof a patch and interdiff.

DickJohnson’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 58: split_bartik_c_css_into-2375673-57.patch, failed testing.

DickJohnson’s picture

Wow.

wim leers’s picture

I haven't finished debugging yet, but I'm betting it has something to do with the different way of loading CSS files to support IE's silly limitations. From CssCollectionRenderer:

        // For file items, there are three possibilities.
        // - There are up to 31 CSS assets on the page (some of which may be
        //   aggregated). In this case, output a LINK tag for file CSS assets.
        // - There are more than 31 CSS assets on the page, yet we must stay
        //   below IE<10's limit of 31 total CSS inclusion tags, we handle this
        //   in two ways:
        //    - file CSS assets that are not eligible for aggregation (their
        //      'preprocess' flag has been set to FALSE): in this case, output a
        //      LINK tag.
        //    - file CSS assets that can be aggregated (and possibly have been):
        //      in this case, figure out which subsequent file CSS assets share
        //      the same key properties ('group', 'every_page', 'media' and
        //      'browsers') and output this group into as few STYLE tags as
        //      possible (a STYLE tag may contain only 31 @import statements).

wim leers’s picture

StatusFileSize
new2.74 KB

My suspicion was correct. But not in the way I thought it'd be; it's a very subtle, very ridiculous problem! :)

It's a combination of:

  1. a not specific enough test: using assertText() to verify strings are present that happen to also be CSS file names (system.theme is a config entity and part of the name of the CSS file /core/modules/system/css/system.theme.css
  2. a silly, silly subtle difference in how assertText() works on <link rel="stylesheet" href="…/system.theme.css"> (HEAD, because there are much fewer CSS files to load) versus <style>@import("…/system.theme.css")</style> (with patch, because we exceed the 31-file limit cited in #62): in the former, the CSS file is in an attribute of the element and hence doesn't match, in the latter, the CSS file is in the textNode of the element and hence does match. I think it'd be fair to say that we never ever ever want to match the text content of a <style> tag, but that's unfortunately how it works in HEAD.

Attached is the suggested interdiff to fix ConfigImportUITest, which makes it more specific. I'll leave it to the people active in this issue to choose which patch to apply this suggested interdiff to; it's not quite clear to me which it should be applied to :)

wim leers’s picture

Assigned: wim leers » Unassigned

The last submitted patch, 45: split_bartik_c_css_into-2375673-44_0.patch, failed testing.

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new136.33 KB
new3.79 KB

Rerolled to #45 and applied Wim Leers patch.

lauriii’s picture

Status: Needs review » Needs work
+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -180,16 +181,16 @@ function testImport() {
+ ¶

Starts looking better. Could we remove that extra space?

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new670 bytes
new136.2 KB

Sure.

lauriii’s picture

Status: Needs review » Needs work
StatusFileSize
new267.14 KB

Menu is still broken:

wim leers’s picture

Yep, this is why I was saying in IRC that the CSS was still broken; during the splitting up into multiple files, some specifically ordered CSS was probably changed.

lewisnyman’s picture

I guess we shouldn't place them in alphabetical order for now until we have cleaned up to selectors so conflict less.

DickJohnson’s picture

Yeah. Media.css must be loaded after others and also files were pointing to wrong directories.

wim leers’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 73: split_bartik_c_css_into-2375673-73.patch, failed testing.

DickJohnson’s picture

Status: Needs work » Needs review
StatusFileSize
new136.28 KB
new1.81 KB

Accidentally removed bartik.libraries.yml from the latest patch.

DickJohnson’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The last submitted patch, 76: split_bartik_c_css_into-2375673-75.patch, failed testing.

DickJohnson’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new134.91 KB
new1.62 KB

Tried to reroll.

Status: Needs review » Needs work

The last submitted patch, 79: split_bartik_c_css_into-2375673-79.patch, failed testing.

DickJohnson’s picture

Fixed the issues on ConfigImportUITest.php.

DickJohnson’s picture

Status: Needs work » Needs review

To see testbot.

Status: Needs review » Needs work

The last submitted patch, 81: split_bartik_c_css_into-2375673-81.patch, failed testing.

lewisnyman’s picture

Status: Needs work » Needs review
StatusFileSize
new121.32 KB

Reroll. I can't see why this would fail now. Where are we changing Bartik settings in this test?

Status: Needs review » Needs work

The last submitted patch, 84: split_bartik_c_css_into-2375673-84.patch, failed testing.

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new121.23 KB
new833 bytes

This patch is not gonna apply because it needs reroll. This should fix the tests.

Status: Needs review » Needs work

The last submitted patch, 86: split_bartik_c_css_into-2375673-86.patch, failed testing.

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new70.82 KB

RErolled

lauriii’s picture

StatusFileSize
new120.75 KB

Last patch didnt remove the styles.css file

wim leers’s picture

StatusFileSize
new126.02 KB

I'm afraid this looks very broken:

Probably a silly mistake? :)

lewisnyman’s picture

I will take a look at this. It's also important to verify that we aren't loosing CSS changes that have been committed when we reroll

I used this command to find all CSS changes in Bartik since: #22

git log --since="2014-11-22" core/themes/bartik/css/

The output was:

commit e89029ce18103ee963c390d526f6d66d6c5f49f6
Author: Alex Pott <alex.a.pott@googlemail.com>
Date:   Mon Dec 1 13:26:32 2014 +0000

    Issue #2368251 by emma.maria, vermario, tkoleary: No border around image upload widget when creating content in Bartik

commit 4fef7db1d97d895be4a26c87016c417d6b76460d
Author: Dries <dries@buytaert.net>
Date:   Wed Nov 26 16:53:27 2014 -0500

    Issue #2365653 by emma.maria, stefan.korn: CSS definition for one sidebar and 560 to 850 px not correct

lewisnyman’s picture

StatusFileSize
new2.26 KB
new120.56 KB

The paths for colors.css and layout.css were wrong. I also changed global-styling to global_styling because it seems consistent with maintenance_page?

Also, we did regress on #2365653: CSS definition for one sidebar and 560 to 850 px not correct so i fixed that.

wim leers’s picture

#92: I'd say: stick to global-styling at least for now, so that it's consistent with every other theme in core? But it's a tiny, tiny detail, so you can choose what you want. We have periods, dashes and underscores all across core. That's another thing to standardize… :P
(Also: AFAICT we use dashes to separate words in filenames as well, including in Bartik, so we probably want to apply the same logic here?)

Other than that: this one works! It looks exactly the same. What's the best way to get this to RTBC? Sit down with two D8 sites next to each other, look at many pages, try to spot any differences?

lewisnyman’s picture

StatusFileSize
new691 bytes
new120.16 KB

I'd say: stick to global-styling at least for now

Sure thing.

It looks exactly the same. What's the best way to get this to RTBC? Sit down with two D8 sites next to each other, look at many pages, try to spot any differences?

Let's make a list of test pages and put them in the issue summary. I might get a PhantomCSS install running to check the pages

wim leers’s picture

Issue summary: View changes

I might get a PhantomCSS install running to check the pages

WOOT! :)

Added some initial steps to the IS. Feel free to expand.

sqndr’s picture

I might get a PhantomCSS install running to check the pages

Great idea! LewisNyman++

sqndr’s picture

Issue summary: View changes

Add the Beta phase evaluation. Please review and make changes. :)

DickJohnson’s picture

StatusFileSize
new132.15 KB

I spent few hours on testing this. Testing was done with latest Chrome and Firefox.

What I did:
1. Added different kind of content of various content types. Long nodes, short nodes, comments etc.
1.1 Also custom blocks
2. Created views listing content, and taxonomy terms inc descriptions
3. I placed the content, blocks and views to all regions, one by one
4. Checked all the listing pages, checked user page, checked article & basic page pages.
5. Added new menus to different regions
6. If I saw anything unusual I took a clean install of Drupal 8 and compared

What I noticed:
There was a lot of moments where I thought something is broken but it wasn't. From my point of view everything is working in the patch.

And as a proof a screenshot that I actually did something. There's no sane way to screenshot that everything is working.

So I'd say RTBC.

-Erno

lewisnyman’s picture

Issue summary: View changes
lewisnyman’s picture

Status: Needs review » Needs work
StatusFileSize
new2.01 KB
new373.99 KB
new473.29 KB
new236.23 KB

Ok, I played around with BackstopJS and found it to be very useful indeed. I've attached my configuration file, renamed to backstop.json._txt, so instead of running gulp genConfig you can just copy my config into the correct place and make sure that it's rename to the .json file extension. You will have to change the URLs to your local install though.

I found some regressions! Some of them are very subtle. The only problem is that the report runs locally and I haven't found a way to share it in a .zip or flat html. The best I can do now is take screenshots of the failures.

DickJohnson’s picture

There seems to be two kind of issues: regression and non-regression issues. Example on non-regression issue is on menu right corner. The bug really is because of ../../../ instead of ../../../../

DickJohnson’s picture

Here is a patch fixing the non-regression issue.

DickJohnson’s picture

Status: Needs work » Needs review
DickJohnson’s picture

It looks like basic copy-paste error instead of regression after all.

DickJohnson’s picture

Forgot the patch.

emma.maria’s picture

Status: Needs review » Needs work
Issue tags: -Needs issue summary update
StatusFileSize
new207.17 KB
new388.72 KB
new182.83 KB
new164.47 KB
new171.31 KB
new309.96 KB
new98.34 KB

The latest patch still has some visual failures.

The sidebar has moved higher up at every screen width...
For example on desktop when it sits on the left of the main content it is higher up.

Desktop testing:

Before patch:

After patch:

And on mobile the same thing happens the sidebar is underneath the main content section, it sits higher up too...

Mobile testing:

Also the primary tabs lose their horizontal line across at every screen width...

Seen in...

Also when Bartik is the admin theme, all of the above happens, plus dropbuttons have lost their styling completely....

Desktop testing...

Mobile testing...

Clear screenshot...

Also with the file structure can we please try to remove hacks.css. If it's contents cannot be placed in a CSS file, please rename to _overrides.css or something similiar.

From all the above this needs a little more work. But it's getting there :)

Edit: I have highlighted the bugs in bold to help them to stand out.

lewisnyman’s picture

Assigned: Unassigned » lewisnyman
lewisnyman’s picture

Assigned: lewisnyman » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.67 KB
new120.67 KB

The tabs issue was a relative image url.
The sidebar issue was a CSS ordering issue, fixed by moving layout.css back up to the top.
The dropbutton problem was because CSS files are still set to replace each other if they have the same name, and for some reason the misc/dropbutton.css is being loaded after the theme dropbutton.css and overwriting it. This is annoying but not a problem to fix in this issue. I copied the naming from Seven and called the file dropbutton.component.css.

Looks like we're almost there?

lauriii’s picture

Status: Needs review » Needs work
StatusFileSize
new212.13 KB

I did huge amount of testing on this and it seems to be working mostly. I've tested all the core modules, even the ones disabled by default. Only thing I could find was these tabs are still having some regression:

lewisnyman’s picture

Status: Needs work » Needs review
StatusFileSize
new1.37 KB
new121.02 KB

Nice, I fixed this problem by moving the vertical tabs CSS from form.css into another file. The filename also has to include .component because there is already a vertical-tabs.css in core. This is still really annoying so I've created an issue here: #2389735: Core and base theme CSS files in libraries override theme CSS files with the same name

lauriii’s picture

Good job! Looks good to me. I can say visually this is RTBC. I haven't looked at the code so I won't RTBC this.

wim leers’s picture

IMHO this makes it much easier to work on Bartik's CSS. Much easier to navigate around. Hurray :)

Here's a code review. It looks great, so only nits.

  1. +++ b/core/themes/bartik/bartik.libraries.yml
    @@ -2,8 +2,44 @@ global-styling:
    +      css/components/dropbutton.component.css: {}
    ...
    +      css/components/vertical-tabs.component.css: {}
    

    Perhaps comments for explaining the reason for the inconsistent filenames would be useful?

  2. +++ b/core/themes/bartik/css/components/buttons.css
    @@ -0,0 +1,25 @@
    +/* ---------------- Buttons    ---------------- */
    +
    +.button {
    
    +++ b/core/themes/bartik/css/components/captions.css
    @@ -0,0 +1,31 @@
    +/* -------------- Captions -------------- */
    +.caption {
    
    +++ b/core/themes/bartik/css/components/content.css
    index 0000000..0b08395
    --- /dev/null
    
    --- /dev/null
    +++ b/core/themes/bartik/css/components/contextual.css
    
    +++ b/core/themes/bartik/css/components/contextual.css
    +++ b/core/themes/bartik/css/components/contextual.css
    @@ -0,0 +1,4 @@
    
    @@ -0,0 +1,4 @@
    +#header .contextual .trigger,
    

    Are these headers still necessary? Aren't they implied by the filename?

    Also: sometimes, they have a newline after them, sometimes they don't. And occasionally, there even is no header at all.

  3. +++ b/core/themes/bartik/css/components/forum.css
    @@ -0,0 +1,6 @@
    \ No newline at end of file
    
    +++ b/core/themes/bartik/css/components/vertical-tabs.component.css
    @@ -0,0 +1,5 @@
    \ No newline at end of file
    

    Missing trailing newline.

emma.maria’s picture

Status: Needs review » Needs work

@Wim Leers for #112

1. We had to name the files like this as for some reason the system CSS files of the same names were stopping the Bartik ones from loading and we were missing CSS. We have this file naming structure in Seven too.

2. We are fixing the headers in a follow up patch or patches. We wanted to just get everything split up, leave the code as it is and then we can improve each stylesheet separately in issues instead of it all being in one monster patch.

3. But yes we do need to fix trailing spaces however! They are a result of the work in this issue.

Setting to Needs Work to fix 3.

wim leers’s picture

#113:

  1. I know :) I'm only saying that it'd be great to add a comment to the YML file to document that, because otherwise surely people will start to open issues for making it consistent.
  2. Ok, sounds fair :)
  3. Please also do 1, so I don't feel super silly for marking this NW for only trailing newlines :P
emma.maria’s picture

Issue tags: +Needs reroll

Hate to say this but after changes to core today, the patch no longer applies.

Checking patch core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php...
Hunk #1 succeeded at 91 (offset -20 lines).
error: while searching for:
    $this->assertSame($groups[5]['media'], 'all');
    $this->assertSame($groups[5]['preprocess'], TRUE);
    $this->assertSame(count($groups[5]['items']), 1);
    $this->assertContains($css_assets['style.css'], $groups[5]['items']);

    // Check group 7.
    $this->assertSame($groups[6]['group'], 100);

error: patch failed: core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php:193
error: core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php: patch does not apply
lauriii’s picture

Issue tags: -Needs reroll
StatusFileSize
new71.08 KB
lauriii’s picture

Status: Needs work » Needs review
lauriii’s picture

StatusFileSize
new51.17 KB
new121.06 KB

This patch fixed Wim Leers' points 1 & 3 from #112. Btw last patch wasn't removing the styles.css so ignore it completely.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

#118 is identical code-wise to #110 (I manually compared), it was merely a rebase on latest HEAD. It was RTBC visually (style-wise) as of #111. It only needed a code review. I just did that.

So: RTBC! :)

emma.maria’s picture

I tested the newest patch visually and the issues in #106 have been fixed.
I also applied the patch and it applied cleanly with no whitespace errors.

RTBC++

sqndr’s picture

Nice! Go Team Bartik!

RTBC++

tim.plunkett’s picture

+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -102,20 +102,20 @@ function testImport() {
-    $this->assertText($name);
-    $this->assertText($dynamic_name);
-    $this->assertText('core.extension');
-    $this->assertText('system.theme');
-    $this->assertText('action.settings');
+    $this->assertRaw('<td>' . $name);
+    $this->assertRaw('<td>' . $dynamic_name);
+    $this->assertRaw('<td>core.extension');
+    $this->assertRaw('<td>system.theme');
+    $this->assertRaw('<td>action.settings');
...
-    $this->assertNoText($name);
-    $this->assertNoText($dynamic_name);
-    $this->assertNoText('core.extension');
-    $this->assertNoText('system.theme');
-    $this->assertNoText('action.settings');
+    $this->assertNoRaw('<td>' . $name);
+    $this->assertNoRaw('<td>' . $dynamic_name);
+    $this->assertNoRaw('<td>core.extension');
+    $this->assertNoRaw('<td>system.theme');
+    $this->assertNoRaw('<td>action.settings');

@@ -177,15 +177,15 @@ function testImport() {
-    $this->assertText('core.extension');
-    $this->assertText('system.theme');
-    $this->assertText('action.settings');
+    $this->assertRaw('<td>core.extension');
+    $this->assertRaw('<td>system.theme');
+    $this->assertRaw('<td>action.settings');
...
-    $this->assertNoText('core.extension');
-    $this->assertNoText('system.theme');
-    $this->assertNoText('action.settings');
+    $this->assertNoRaw('<td>core.extension');
+    $this->assertNoRaw('<td>system.theme');
+    $this->assertNoRaw('<td>action.settings');

Why all these changes? I don't see how they are related?

wim leers’s picture

@Tim: see #62 and #64. Basically: those tests verify config keys showing up in the HTML source, but some of those keys happen to be identical to asset file names!

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new126.41 KB

I'm sorry but I found one more bug on the RTL layout:

sqndr’s picture

Could you tell us where you found the bug - on what page? Is this since the patch?

wim leers’s picture

@sqndr: that's the node form in a narrow viewport.

lewisnyman’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new619.12 KB

I tested this scenario without the patch and it already exists in HEAD. This problem was not introduced in this patch.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 118: split_bartik_c_css_into-2375673-118.patch, failed testing.

DickJohnson’s picture

I can confirm lewisnymans report. It exists in core already.

lewisnyman’s picture

Status: Needs work » Reviewed & tested by the community

Phew, it was a ghost fail :D

wim leers’s picture

The pre-existing RTL problems in #125–#128 are going to be fixed by #2329649: Fix node create page RTL CSS and don't conflict with this patch :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 118: split_bartik_c_css_into-2375673-118.patch, failed testing.

DickJohnson’s picture

Issue tags: +Needs reroll

Patch doesn't apply to latest head. Needs reroll.

DickJohnson’s picture

Issue tags: -Needs reroll

No, sorry, it should work after all.

DickJohnson’s picture

Status: Needs work » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wow, great work on this, folks! Exciting to see Bartik getting some love in D8. :)

I will fully admit I did not review every line of this patch. :) However, I can see that lots of effort and testing went into this, and if it does introduce some bugs, much easier to fix them in tiny ~500b patches than as part of a ~150K patch.

Since this is a markup-affecting patch, it's under the list of things we can commit at https://www.drupal.org/contribute/core/beta-changes, committed and pushed to 8.0.x. YEAH! :)

  • webchick committed e6afbff on 8.0.x
    Issue #2375673 by DickJohnson, LewisNyman, lauriii, emma.maria, sqndr,...
emma.maria’s picture

Yay an early Christmas present! Thanks Webchick, thanks all for your hard work.

Status: Fixed » Closed (fixed)

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