Problem/Motivation

user.module.css contains visuals styles - they should be in user.theme.cs

Proposed resolution

move the css over so all visual styles are in theme, and only the functional css is inside module.css, following our css standards (MAT) #1887922: [Obsolete] CSS file organization

Remaining tasks

wait for #1663210: Clean up css in the User module that cleans up the csslint errors, then refactor this patch

User interface changes

API changes

Comments

lewisnyman’s picture

Issue tags: +Novice

This sounds noviceish

vermario’s picture

Assigned: Unassigned » vermario

Ok, I will have a shot at this. :)

vermario’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

Patch attached.

- I added the new css file in the user.libraries.yml file
- I moved all styles having to do with presentational features (colors, etc) to the new file
- I left structural properties (layout, etc) in the old one.

Please review :)

vermario’s picture

StatusFileSize
new2.35 KB

Please ignore the previous patch, the newly added file was missing.

(using Sourcetree git GUI for this, and I missed one step).

Should be good to test now.

idebr’s picture

Status: Needs review » Needs work

@vermario Thanks for picking this up! I did a manual test as well and found no regressions.

There is one minor code style issue that should be fixed before this patch can be committed:

+++ b/core/modules/user/css/user.theme.css
@@ -0,0 +1,26 @@
+/**
+ * Password strength indicator.
+ */

Every css file should start with a @file docblock. Suggestion:

+/**
+ * @file
+ * Styling for the Password strength indicator.
+ */
mortendk’s picture

Status: Needs work » Needs review
StatusFileSize
new4.38 KB
new78.71 KB
new123.57 KB

made a couple of fixes in this patch:
- fixed the lint errors in the css file (http://lewisnyman.co.uk/drupalcore-frontend-toolkit/)
Theres one lint error we cant fix and thats the
- moved all visual styles to theme.css
- added background colors to the indicator in user.module.css (gray & lightgray, cant remember if we have a policy on colors ?) if theres no background color, it dosnt look like its working, so it would be very confusing for anybody "where did the indicator go" - we can bikeshed the colors, i think its fairly safe to just go with 2 gray tones.
Anyways there need to be a bgcolor in the module to make it work

also screenshots:
with theme

without

idebr’s picture

Status: Needs review » Needs work

@mortendk Thanks for working on this issue. There is an effort to clear user.admin.css of lint errors in #1663210: Clean up css in the User module. Can you separate those changes from this patch to prevent scope creep?

mortendk’s picture

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

totally! and yes less scope creep ;)
new patch uploaded - removed the creeping , im gonna go review the other one

Status: Needs review » Needs work

The last submitted patch, 8: user_module_css-2421397-8.patch, failed testing.

mortendk’s picture

Assigned: vermario » mortendk
Status: Needs work » Needs review

huh testbot really ?

idebr’s picture

Status: Needs review » Needs work

I'm fine with using some default colors for the password indicator colors. On the other hand, one could also argue we should keep them in user.module.css file since the colors are not only visual but also functional.

  1. +++ b/core/modules/user/css/user.module.css
    @@ -1,4 +1,5 @@
     /**
    + * @file
    ...
      */
    
    +++ b/core/modules/user/css/user.theme.css
    @@ -1,38 +1,42 @@
     /**
    + * @file
      * Password strength indicator.
      */
    

    Let's update the @file docblocks to indicate why the css is split up between user.module and user.theme.css files. Eg. 'Password strength indicator component.' for user.module.css and 'Visual styling for the Password strength indicator component.' for user.theme.css

  2. From user.module.css
    div.password-confirm {
      visibility: hidden;
      width: 55%;
    }
    

    For consistency, let's move all width: 55%; code to theme or keep all of it in .module. Right now it is split between both.

mortendk’s picture

Issue summary: View changes
Status: Needs work » Needs review
Parent issue: » #1663210: Clean up css in the User module
StatusFileSize
new3.93 KB

moved the div.password-confirm over and corrected the doc blocks.

Yes the colors are functional, hency why its gray and lightgray, so the visual element is still there, but not confused with a color scheme & as neutral as possible.
Its one of those bikesheds that i think we should try not getting into ;)

mortendk’s picture

Status: Needs review » Closed (duplicate)