Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixelwhip’s picture

Assigned: pixelwhip » Unassigned
Status: Active » Needs review
FileSize
6.56 KB
Shyamala’s picture

Issue tags: +mobile, +d8mux, +d8mux-css-cleanup

Adding tags

Shyamala’s picture

Issue summary: View changes

Updating issue Summary

psynaptic’s picture

Why are we not using the following?

.layout-sidebar-first
.layout-sidebar-last
.layout-no-sidebars
.layout-two-sidebars
pixelwhip’s picture

The .l-* is the naming convention currently listed in the CSS Standards draft. That is why it is used here.

As to whether or not it should be changed, I imagine is up to debate until that doc is no longer draft. I'm personally fine with the abbreviated syntax as that is what is recommended in SMACSS and is more likely to become a convention outside of Drupal.

psynaptic’s picture

I just think it's a bit idiosyncratic.

Drupal has long espoused an admirable coding standard to avoid abbreviating the names of things to avoid encoding their meaning. I don't follow SMACSS per se but after reading the linked article it seems that I do indeed do everything described in my regular workflow (except use abbreviated classnames).

In the comments of the linked article, Jonathon Snook uses the following example when responding to a question (indentation/spacing mine):

@media screen and (min-width: 800px) {
  .layout-contact .content { float: left; }
  .layout-contact .sidebar { float: right; }
}

Not having read through the whole SMACSS documentation, I think the general guidelines it presents makes a lot of sense and I'm all for adopting these patterns within Drupal but I do think the smaller details such as adopting the specific naming of things are much less important.

Does anyone else have strong feelings on this?

pixelwhip’s picture

I don't have strong feelings either way.

oresh’s picture

@pixelwhip, @psynaptic,
I think there is no difference from using l- or layout-
The naming conventions will take something like 10 line of documentation, and every themer can read them without any problem, before starting work.
I personally think we should keep the prefixes short, so it takes a little bit less time to understand what does a specific style do. And less time to write and mistake chance is lower: for foreigner not knowing English so good, 'layout' can be spelled with a mistake, but l- is more likely to be ok :)

oresh’s picture

All class names are proper and work fine. +1

oresh’s picture

Status: Needs review » Reviewed & tested by the community
xjm’s picture

For anyone else who did a double-take thinking "No way are those valid class names," those classes start with the lowercase letter L, not the numeral 1.

webchick’s picture

Assigned: Unassigned » JohnAlbin
Status: Reviewed & tested by the community » Needs review

If someone can confirm/deny whether or not ".l" specifically is part of the recommendations at http://smacss.com/book/type-layout, that would be great. From my interpretation, it sounds like the method described there is part of the spec, not the specific, obtuse "l-xxx" class names which have screwed up at least 3 people reading this issue (myself included). I really disilke code standards guidelines like "don't ever abbreviate names of things" that have "oh, except for..." after them. :\ Makes it really difficult for reviewers and contributors alike.

Not marking "needs work," but marking "needs review" and assigning to John in case he can shed further light on this. I would much prefer to spell out "layout" here so it doesn't screw up anywhere else, as long as people familiar with SMACSS won't find this a weird Drupalism.

dead_arm’s picture

In the SMACSS book Snookca does use ".l-" for layout, but that doesn't mean we need to.

In his talk at DrupalconPDX, the question of naming as it applies to classes and so on was put forward during Q&A, and his response was (and I'm paraphrasing) "Find conventions that work for your team."

I don't think that adding ".l-" is an improvement over what we have now. I am in favor of ".layout-". I realize that there could be the introduction of spelling error, brought up in #7, but at least a full word is translatable and adds more context than just a letter.

Sumit kumar’s picture

Status: Needs review » Needs work

The last submitted patch, 1: drupal-rename-layout-classes-1054616-1.patch, failed testing.

LewisNyman’s picture

Assigned: JohnAlbin » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
FileSize
9.83 KB

I prefer to use more meaningful names. I think it's hard to argue for '.l-' because it's so minimal. This is coming from someone who didn't realise what the l() function in core did for ages :P

Considering how old the previous patch way it seems easier just to rewrite it from scratch, please check to see if I've missed them somewhere.

Status: Needs review » Needs work

The last submitted patch, 15: drupal-rename-layout-classes-1054616-15.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 15: drupal-rename-layout-classes-1054616-15.patch, failed testing.

Anonymous’s picture

I'm going to be *that person* and ask why, in the age of responsive design and semantic markup, we're still referring to them as "sidebars" and not "asides." Would this be a reasonable change to make? Also, perhaps "aside-before" and "aside-after" would be more reasonable than "aside-first" and "aside-second," since many sites only use one or the other.

echoz’s picture

LewisNyman’s picture

This issue has kind of stalled. The best place to debate the CSS standards is here and they have already been RTBC'd. I think we should follow them for the time being and maybe take the '.l-' vs '.layout-' discussion over there.

LewisNyman’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 15: drupal-rename-layout-classes-1054616-15.patch, failed testing.

barraponto’s picture

Status: Needs work » Needs review
FileSize
4.3 KB

Here's a re-roll of #15. I've reverted to l- prefixes, following our standards. I hope there's still room to change the standards and adapt CSS later - but for this issue I'm sticking with l-.

Status: Needs review » Needs work

The last submitted patch, 24: drupal-rename_layout_classes-1054616-24.patch, failed testing.

barraponto’s picture

Status: Needs work » Needs review
RainbowArray’s picture

Almost all of the comments above endorse the usage of layout- rather than l- in class names. So if we're going to introduce this change, why not just make the change to what most people would like to see?

barraponto’s picture

@mdrummond I'd rather open a new issue for that.

LewisNyman’s picture

Almost all of the comments above endorse the usage of layout- rather than l- in class names. So if we're going to introduce this change, why not just make the change to what most people would like to see?

Everyone who was involved in the creation of the CSS guidelines is not following this issue. It's not immediately clear that we are making a policy change in this issue either. I'd rather we didn't make the decision here.

barraponto’s picture

Sumit kumar’s picture

The last submitted patch, 1: drupal-rename-layout-classes-1054616-1.patch, failed testing.

Sumit kumar’s picture

24: drupal-rename_layout_classes-1054616-24.patch queued for re-testing.
this patch is needed retest

Status: Needs review » Needs work

The last submitted patch, 24: drupal-rename_layout_classes-1054616-24.patch, failed testing.

echoz’s picture

Status: Needs work » Needs review
FileSize
4.4 KB

#2207647: [policy, no patch] Use layout- prefixes instead of l- in CSS Coding Standards went through deciding to use "layout-" so here's the #24 patch back to using that.

Status: Needs review » Needs work

The last submitted patch, 35: layout_classes-1912610-35.patch, failed testing.

Rajendar Reddy’s picture

Applying patch with reroll and required changes which fixes this issue. Please review.

Status: Needs review » Needs work
LewisNyman’s picture

Status: Needs review » Needs work
Rajendar Reddy’s picture

Submitting patch again.

LewisNyman’s picture

Issue tags: +frontend, +CSS
emma.maria’s picture

Issue tags: +Novice
emma.maria’s picture

dead_arm’s picture

Issue summary: View changes

Updating classes in issue to follow naming.

bdevore’s picture

patch fails to install on simplytest.me

cfox612’s picture

Status: Needs review » Needs work

Patch fails to install

emma.maria’s picture

The patch no longer applies so a reroll is needed.

dead_arm’s picture

Related: #2234331: Change the body classes to follow Drupal 8 CSS standards proposing to remove sidebar classes altogether

dead_arm’s picture

acabouet’s picture

Assigned: Unassigned » acabouet

I'll take on this issue as my first patch!

acabouet’s picture

Assigned: acabouet » Unassigned
Status: Needs work » Needs review
lokapujya’s picture

Rerolled.

Someone should look at the uses of l-sidebar in these files and see if it is changing those is relevant to this issue:
core/modules/system/templates/install-page.html.twig
core/themes/seven/maintenance-page.css
core/themes/seven/templates/install-page.html.twig
core/themes/seven/templates/maintenance-page.html.twig

If no one looks at by next week, I'll take a closer look at it.

lokapujya’s picture

Status: Needs review » Needs work

Needs work as mentioned in #53.

BryanCGreen24’s picture

Assigned: Unassigned » BryanCGreen24

I'll take a peek at this later today.

BryanCGreen24’s picture

All the files mentioned in #53 need to be edited to reflect this naming convention change. Patch to come.

BryanCGreen24’s picture

Ugh, sorry...ignore this patch-- it's jacked up. Fixing now.

BryanCGreen24’s picture

BryanCGreen24’s picture

OK, sorry, this is my first patch. Here's the new-and-improved version.

BryanCGreen24’s picture

Status: Needs work » Needs review
lokapujya’s picture

Status: Needs review » Needs work

The latest patch is basically an interdiff from #53 which is good to have. We also need the complete patch diffed from 8.x head.

The new changes look good to me.

BryanCGreen24’s picture

Ahhh, OK. Sorry, I'm still learnin'!

Bryan

BryanCGreen24’s picture

Hmm...I get this error when I try applying the patch from #53:

error: core/modules/block/custom_block/src/Tests/CustomBlockListTest.php: No such file or directory

I even re-cloned the D8 repo just to make sure I wasn't missing any files, but there's no 'custom_block' directory in /core/modules/block/...what kind of noob mistake am I making?

Thanks!
Bryan

lokapujya’s picture

Issue tags: +Needs reroll

That file got renamed since my patch. So, now it needs a reroll, and then you can apply your patch. See https://drupal.org/patch/reroll.

BryanCGreen24’s picture

FileSize
11.37 KB

OK, here is the patch from #53 re-rolled.

Auto-merge, no conflicts.

BryanCGreen24’s picture

Status: Needs work » Needs review

If the re-rolled patch from #65 passes testing, I'll add my patch from #59.

BryanCGreen24’s picture

FileSize
15.79 KB

Whew! OK, here is the patch that combines the re-rolled patch from #65 with the patch I created on comment #59.

Many thanks to lokapujya for his patience and guidance!

Bryan

lokapujya’s picture

Status: Needs review » Needs work
+++ b/core/modules/system/templates/maintenance-page.html.twig
@@ -64,4 +64,5 @@
+

Un-needed new extra blank line. Other than that, it looks good to me. You can also remove the "Needs reroll" tag.

amitgoyal’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
14.18 KB
1.65 KB

Please review updated patch as per fixes in #68.

Please note that changes in file core/modules/block_content/src/Tests/BlockContentListTest.php are no longer required as those changes are already in core.

Status: Needs review » Needs work

The last submitted patch, 69: drupal-rename-layout-classes-1912610-69.patch, failed testing.

BryanCGreen24’s picture

FileSize
15.79 KB

Patch from #67 with extra newline removed.

BryanCGreen24’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

I went through all the themes, and install.php, and I don't see any layout bugs. I also had a look through the themes and modules to look for remaining .l- classes and I couldn't find any.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, much better. :) Thanks for all the hard work on this.

Committed and pushed to 8.x. Thanks!

  • Commit fc360e0 on 8.x by webchick:
    Issue #1912610 by amitgoyal, BryanCGreen24, lokapujya, Rajendar Reddy,...

Status: Fixed » Closed (fixed)

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