Problem/Motivation
The code in block.css has selectors that are too general. For example, it targets every list in every block and forces padding on them even if the component is meant to look individual to everything on the page.
CSS should be component specific and block is a too general term, especially when the selector is combined with html elements.
It is causing us to either overwrite the styles all over the place.
or
It is causing visual regressions in RTL where we need to force styles to override the block.css code in RTL for specific components, that's not how RTL rules are supposed to be. See... #2502135: Bartik footer block menu-item misaligned in RTL.
or
There are also very obvious visual bugs in Bartik right now caused by the code in block.css....

Proposed resolution
Find where these list styles are needed to be used and add them to that specific component only.
As far as I can see it's only for components that have printed bullet points and need the bullet points to not sit on the edge of the block. The example below is from the user login block....
With block.css styles

Without block.css styles.

Remaining tasks
Write a patch
Code review
Visually review as many blocks on the page to see if we have any regressions.
RTBC
User interface changes
None, apart from fixing any small visual bugs caused by the current block.css code, like the one I pointed out in the Problem/Motivation section.
API changes
None
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | remove-block-css-from-bartik-2509902-9.patch | 2.83 KB | emma.maria |
| #8 | remove-block-css-from-bartik-2509902-8.patch | 2.32 KB | emma.maria |
| #8 | Screen Shot 2015-07-28 at 12.24.01.png | 64.57 KB | emma.maria |
| #3 | 2509902-3.patch | 2.34 KB | munzirtaha |
| Screen Shot 2015-06-22 at 12.04.15.png | 20.01 KB | emma.maria |
Comments
Comment #1
emma.mariaComment #2
munzirtaha commented@emma.maria: I am also in favor of removing many rules that needs to be overridden in too many places while not having a significant advantage. However, my starting patch would include core css files so I am not sure whether we can update the bug title and component or it's better to open a new bug for it. You decide. I will start with a simple clean up that would solve the issues you have mentioned beside deprecating my patches for issue #2502135 and issue #2501843.
Comment #3
munzirtaha commentedA new revision
Comment #4
manjit.singhComment #5
manjit.singh@munzirtaha I think we have to do a cleanup of all RTL styles. which are not need just remove it as you did in #3. Is it making sense ?
@Emma Please share your views as well.
Comment #6
emma.mariaComment #7
emma.mariaComment #8
emma.maria@munzirtaha so the idea I had for this was to remove the offending block.css code that is causing so many visual problems all over the place. And put that code in within other component files where it was specifically needed.
We also can't affect too much in Core code also, this is just a problem with Bartik's code specifically.
I have created the following fresh patch to show what I mean.
Also screenshot.
Comment #9
emma.mariaOops a file didn't make it into the patch. Here's a better one!
Comment #10
lewisnymanIt would be great to fix the code in system.theme.css so we don't have to add ul to this. Once #2395853: Split system.module.css and system.theme.css files into SMACSS style components is committed, we can work on an issue to fix the CSS in system/menu.theme.css
I'm happy to RTBC this as is, but only if we have the chain of issue dependancies in place.
It would look like this:
#2395853: Split system.module.css and system.theme.css files into SMACSS style components -> Fix system/menu.theme.css -> Fix Bartik/menu.css
Comment #11
emma.mariaComment #12
lewisnymanI've created the issue that prevents this file from being completely fixed. #2550805: Clean up menu.theme.css inline with our CSS standards
Comment #13
emma.mariaBlock list CSS was removed as part of this issue #2548805: Add sensible base layout styles for lists in Bartik. so now there is no code to remove. Setting this to Closed (duplicate).