Problem/Motivation
The BAT (base-admin-theme) file organization we started to do in Drupal 8 was a fantastic idea. See http://drupal.org/node/1089868
It works really well, but its names conflict with the SMACSS categorization we're using in Drupal 8. "base" and "theme" means something else in SMACSS. So we just need to rename them.
Note: this is part of the meta issue: #1921610: [Meta] Architect our CSS
Proposed resolution
MODULE.base.css becomes MODULE.module.css.
MODULE.admin.css stays the same (but requires adding a MODULE.admin.skin.css so admin themes can override the default skin).
And MODULE.theme.css becomes MODULE.skin.css.
In addition, since our template files are now in a templates sub-directory of a module, we should do the same for the CSS. Note that the toolbar, tour and views modules already put styles in a css/ directory.
This is part of the CSS standard described at http://drupal.org/node/1887922
This patch (one of several issues) just converts all of the core modules that only have *.admin.css files and puts them in a css/ sub-directory:
- block
- color: There is another issue related to this module Clean up the CSS for Color module
- dblog
- entity_reference
- field_ui
- file
- filter
- help: There is another issue related to this module Clean up the CSS for Help module
- language
- layout
- locale: There is another issue related to this module Clean up the CSS for Locale module
- menu: There is another issue related to this module Clean up the CSS for Menu module
- translation_entity
- update: There is another issue related to this module Clean up the CSS for Update module
Remaining tasks
After this issue's completion, we still have all the other steps outlined at #1921610: [Meta] Architect our CSS.
User interface changes
none
API changes
The system.module's CSS files will have new names.
| Comment | File | Size | Author |
|---|---|---|---|
| #40 | 1925320-40-rename-css-files.patch | 14.93 KB | johnalbin |
| #37 | d8-rename-module-css-dblog-1925320-37.patch | 410 bytes | carwin |
| #30 | rename-module-css-1925320-30.patch | 35.8 KB | rteijeiro |
| #27 | rename-module-css-1925320-27.patch | 35.44 KB | ckrina |
| #25 | 1925320-rename-module-css-25.patch | 32.99 KB | ckrina |
Comments
Comment #1
ckrinaTesting with that:
- Moved the block.admin.css file to a new "css" folder created in the module.
- Changed the name from block.admin.css to block.admin.skin.css.
Comment #2
ckrinaChanging status to "needs review" to test patch.
Comment #3
aspilicious commentedComment #4
sunPlease adjust your git configuration to use renames=copies. See Configuring Git for details.
Comment #5
ckrinaThanks aspilicious.
sun: ok, I'll check it and then I will upload the rest ofe the patch.
Comment #6
ckrinaChanges done in all modules mentioned in the issue:
- Rename MODULE.css or MODULE.admin.css to MODULE.admin.skin.css
- Moved all in the new module css folder.
- Moved -rtl.css files to css folder too, and renamed as MODULE.admin.skin-rtl.css (based on language.module function language_css_alter). Anyway, left previous name fors entity_reference-rtl.admin.css to entity_reference-rtf.admin.skin.css because I'm not sure how it works.
Comment #8
ry5n commentedI just want to point out that module.admin.css should remain, containing structural styles only (layout, component styles required for functionality). The styles that are moved to module.admin.skin.css should be those related to appearance, like border, background, border-radius, etc.
Comment #9
shyamala commentedUpdating tags
Comment #10
ckrinaOK, first thanks for help to novices.
Here I add separate block and color patches. What I've done to them:
- block
- color
Comment #11
ckrinaI'll put all together into a single patch when all of them are correct.
- dblog
- entity_refrence
- field_ui
Comment #12
amateescu commentedI think you could post intermediary patches with the "-do-not-test" suffix. The 5 from above will generate 5 hours of testbot working time which could be spent on dozens of other patches..
That being said, would you mind if I cancel their testing so other sprinters can have a chance at seeing the result of their patches today? :)
Comment #13
ckrinaSure, I did not know that!
Comment #15
ckrinaMoved the css files of the listed modules to the new css/ directory, and changed the refrence to it in the module files.
I've done some other changes that would be great that someone more confortable with D8-css-structures could review. Those changes are:
block
- separated block.admin.css and block.admin.skin.css
- changed reference to css in block.admin.inc and lib/Drupal/block/BlockListController.php
entity_refrence
- Changed name from entity_reference-rtl.admin.css to entity_reference.admin-rtl.css (not sure if it's correct)
filter
- separated admin.css and admin.skin.css
help
- rename help.css/help-rtl.css to help.admin.css/help.admin-rtl.css (not sure if it's correct)
help
- rename update.css/update-rtl.css to help.admin.css/help.admin-rtl.css (not sure if it's correct)
Attaching the whole patch in a zip so it can be tested but not requires testbot untill I'm sure the changes are fine.
Comment #16
ckrinaComment #17
rteijeiro commentedHi ckrina, the patch returns some errors when applied:
I'm reviewing the code.
Comment #18
rteijeiro commentedThe patch doesn't create the css files for some modules. It only deletes the css files.
I guess it's needed to recreate the patch again.
Comment #19
rteijeiro commentedI have created the patch from scratch. Hope now it's right.
Comment #20
ckrinaHi rteijeiro, thanks to take a look to that. I wasn't able to follow it the past days.
I've been testing your patch and I think there are some problems:
- The old CSS files outside the css folder aren't deleted for this modules:
- block
- color
- Modules that have more than one new css file aren't loaded. For example: block.admin.skin.css or color.admin.skin.css. Probably because they are not called from the modules files. Hope it helps.
Comment #21
rteijeiro commentedThanks ckrina.
Just fixed the patch.
Comment #23
rteijeiro commentedOther try :P
Comment #24
ckrinaAll files are detected now.
But core/modules/block/block.admin.css and core/modules/color/color.admin.css still aren't deleted.
And the last problem I have detected is that in dblog some path icons need to be updated.
Comment #25
ckrinaI've made this changes in the patch. Hope it works.
Comment #27
ckrinaSorry, uploading the correct one. This one should work.
Comment #28
rteijeiro commentedIt seems good form me.
We must take into account that there are other issues where we are working on the same css files (see the summary of this issue).
I will mark it as RTBC. Feel free to change to needs work if you notice something else.
Comment #29
dcam commentedThe image URLs in the following styles from moved CSS files need to be updated like "images/hook.png" to "../images/hook.png".
Comment #30
rteijeiro commentedDone!
Comment #32
rteijeiro commented#30: rename-module-css-1925320-30.patch queued for re-testing.
Comment #34
dcam commentedThis is going to need a reroll since we're dropping the change from "theme" to "skin". See http://drupal.org/node/1921610#comment-7366314.
Comment #35
johnalbinComment #36
johnalbinSorry for the delay in reviewing these patches. My bronchitis flared up and I've been too sick until this week to get back into the issue queue.
Lots of discussions have happened in the interim. We just held a D8 Mobile Initiative meeting on Google+: https://plus.google.com/u/1/events/c0knva4lgh4vot0nun5lbfel9fc where we decided that we could make the CSS re-archicture work move faster by moving the work into a sandbox git repository. Then we could commit lots of little issues to the sandbox and roll larger, more-complete patches into Drupal 8’s issue queue. (per webchick's request)
So you're work is not lost! I'm moving this issue to the Mobile Initiative sandbox. :-)
Comment #37
carwin commentedHere's a patch that moves the css files in the dblog module into a css directory.
Comment #38
mtiftA number of previous patches included various directory changes that I think we should keep (due to the added css directory). I less certain that some of the previous CSS changes should be rolled back in as well.
Comment #39
johnalbinI'm working at untangling the patch. This issue was JUST about moving CSS files around for all of the listed modules. Refactoring at the same time makes it too unwieldy to review. Thanks for the initiative, but I'm having to strip that out for now.
Comment #40
johnalbinOk! This has been committed to the sandbox! Thanks!
Comment #41.0
(not verified) commentedNotify duplicated issues.