Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
CSS
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
12 Jul 2011 at 22:15 UTC
Updated:
29 Jul 2014 at 19:47 UTC
Jump to comment: Most recent file
Comments
Comment #2
mdm commentedComment #3
mortendk commentedtag
Comment #4
mortendk commentedtaking this one
Comment #5
mortendk commentedsplit up the css so its in admin & theme
cleaned out the stuff from #book-admin-edit have a hard time justifieng its existence or am i wrong there ?
Comment #6
jacineWoot! Happy that you are working on this Morten! Go go go :)
Comment #7
mortendk commentedForgot the admin.theme.css file
Comment #8
mortendk commentedforgot the book.theme.css file
Comment #9
mortendk commentednewlines added ...
Comment #10
jacineOkay, just reviewed this and found a couple of issues with the patch:
_book_admin_table_tree()doesn't seem like the right place to load book.admin.css. I'm going to ask around about this.The rest looks good to me! Go Morten go! :D
Comment #11
tstoecklerThis should use the #attached syntax.
Comment #12
mortendk commentedthis should do it
Comment #14
mortendk commentedokay lets try again
have no clue why evil test bot dont give me any love
Comment #15
jacineYeah, hopefully that one works... We still need to deal with adding the book.admin.css file. I don't think that function is where it should be added, and @tstoeckler's right that it should probably use #attached.
Comment #16
mortendk commentedyeah tried to get that one in but evil bot keept messing with me
Comment #17
sunThis should go into _book_admin_table() instead, as the _tree helper calls itself recursively for each level of the entire book tree -- simply use #attached on the initial $form['table']
Aside from that, I'm not 100% sure that all of the non-admin CSS belongs into .theme (i.e., with no or nothing in .base) -- does the output still "work" in Stark after manually removing book.theme.css from the output?
23 days to next Drupal core point release.
Comment #18
mortendk commentedthe output still works in stark after killing the book.theme.css - ive added 2 screenshots
im pretty sure we should fix the navigation class names so they got unified all over drupal, but that thats another issue though.
Comment #20
mortendk commenteddidnt get the new files ...
Comment #21
mortendk commentedlets try with the need review added ..
Comment #23
mortendk commentedcan someone tell my why the testbot gimme:
error: modules/book/book.admin.css: No such file or directory
error: modules/book/book.theme-rtl.css: No such file or directory
error: modules/book/book.theme.css: No such file or directory].
now that they are defined in the patch
index e69de29..1ec4614 100644
--- a/modules/book/book.admin.css
+++ b/modules/book/book.admin.css
@@ -0,0 +1,12 @@
+#book-outline {
+ min-width: 100em;
+}
+.js #edit-book-pick-book {
+ display: none;
+}
+.form-item-book-bid .description {
+ clear: both;
+}
+#book-admin-edit .form-item {
+ float: left;
+}
Comment #24
tim.plunkett@mortendk, that patch looks whack. If you upload a zip of the book module directory, I can reroll a patch for you...
Comment #25
dave reid@morten: Your Git diff is formatted in such a way that a book.admin.css must exist prior to patching rather than creating a new file.
Comment #26
mortendk commentedalright one more time for prince knud
Comment #28
mortendk commentedComment #29
sunLooks pretty much RTBC after changing that drupal_add_css() call into #attached
Comment #30
mortendk commentedComment #31
droplet commentedneeds alphabetized properties :)
http://drupal.org/node/302199
Comment #32
tr commentedRe-rolled #30 with alphabetized properties. I also checked all the modified CSS against the CSS coding standards, and found no other problems.
Comment #33
tr commentedDisregard #32, I accidentally left the newly defined .css files out of the patch.
Attached is the proper patch that corresponds to #30 but with alphabetized properties.
Comment #34
mgiffordSubscribe. Hope to see this get into D8 -> #736604: book module now without clearfix & better markup + accessibility love without bumping into this cleanup initiative.
Comment #35
tr commentedRerolled patch to account for changes committed in #120368: Book outline page breaks my site layout
@mgifford: Can you review this?
Comment #36
mgiffordI tested this against core. It looks good. Thanks for keeping up with core!
Comment #37
jacineUpdated the issue summary to include full information about what "clean up" means.
Comment #38
jyve commentedJust tested this patch and here is my feedback, and a new patch reflecting that feedback:
- The rules below in admin.css looks like it belongs in base.css. This is module behavior and not styling. Also, these rules apply to the node edit form, and admin.css was not being loaded there. I've moved them to base.css and added base.css to the form alter for the node edit form.
- The last css rule in admin.css adds a useless float, since that form-item is nicely handled by the draggable table layout.
- Since (re)moving these rules empties the admin.css, I've removed it entirely.
New patch attached!
Comment #39
jyve commentedAdded @file and block level comments as requested in another thread.
Comment #40
xjmThanks for the patch. Note that the Drupal 8.x patch will need to be rerolled, because the core directory structure for Drupal 8 has now changed. (For more information, see #22336: Move all core Drupal files under a /core folder to improve usability and upgrades). When the patch has been rerolled, please set the issue back to "Needs Review."
Tagging as novice for the task of rerolling the Drupal 8.x patch.
If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.
Comment #41
xjmOops, forgot to set status.
Comment #42
jyve commentedRerolled the patch for the new folder structure.
Comment #43
mortendk commentedput the book navigation into
remove the book-navigation-
print $book_id;id to stop the ID madness.Comment #45
xjmNote that this patch removes the terminal newline from this file, so we'll need to add that back. (Put the cursor on the last line and hit enter.)
Comment #46
xjmAnd apparently it also needs some other work. :)
Comment #47
mortendk commentedooh my so i also have to rewrite the .test file ?
- this patch made the navigation have the same markup as the pagers ?
Comment #48
cleaver commentedI've done some work on the test for Morten's patch--cleaned up about half the fails so far. I'll post whatever I get done so that it can be reviewed.
Comment #49
cleaver commentedChanged the book.test for #43
Comment #50
xjmPlease add the newline here back (as per #45).
Comment #51
cleaver commentedFix that pesky newline :)
Comment #52
xjmYay!
Comment #53
jacineWait, what's going on here?
book.theme.cssorbook.base.csscontents that Morten added.book.theme.cssis loaded by default andbook.base.cssis not, but it also seems to make sense.Other than those issues the CSS, and comments look good. I think that the other patch is close. I'm going to go review it now.
For now, let's re-roll with just the CSS changes.
Comment #54
mortendk commented1 well wasn't aware of the work on the markup in another issue
im gonna move it out and post it over at the other issue, even imho i think thats double work .. ooh well.
hmm looks like book.base.css should actually be a book.admin.css instead
Comment #55
jyve commentedLooking at the feedback from Jacine in #53, it feels like the patch in #42 is still correct, right? At least until the other patch get's in, and we can remove some css here.
@mortendk: this looks like a typical piece of CSS for a base.css instead of admin.css? It's basic hide/show behavior, not styling.
Comment #56
mortendk commentedyup but its only effective in the admin part of the module. Its not relevant to the rest of the modules functionality
The idea in .base.css is a crucial element to the overall modules functionality that you will always carry around, so in this case i would argue that its an "admin thing" and not a "overall functionality of the module"
so i think we should add it to the admin.css file & remove the base.css file in the book module.
... even that it could be seen as a little bikeshedding ;)
Comment #57
jyve commentedOk then, one more attempt from my side :)
1. The editing of content can be done in frontend and backend theme, so the CSS currently in base.css would not be available if a user removes all theme.css files and would remove basic behavior in that way.
2. This is what is said in the issue description:
That said: I promise not to kill anyone for putting it in admin.css, so the decision is up to you :)
Comment #58
mortendk commentedhmm looks like we have hit the first "is it admin or base" dilemma
in my view its an administration task so it should be in the admin.css - its not crusial to the functionality of the module (aka it dosnt break anything if we leave it out) it just looks funky in the tab under book options with that big gray button.
I have rerolled it & killed the ID in the book-navigation.tpl - guess thats okay- even that we have the other issue about the general markup ?
could somebody else weight in here, so we can get a good concensus about the BAT files ?
Comment #59
mortendk commentedim an idiot this is the patch rerolled with the base.css -> admin.css renaming.
no markup changes etc. that we can take on later ? when this one is in ...
Comment #60
mortendk commented...and this time with review status #facepalm
Comment #61
xjmRegarding #58, I had similar doubts about a .admin.css in another issue. Is there a meta discussion somewhere for that point?
#60 looks pretty good, outside of that question. (I had no idea what to make of #43 but I sure knew it shouldn't take away our terminal newline.) ;)
An aside: When you mark an issue needs review, it tests all previously untested patches. So if you forget when you upload the patch, no need to upload it a second time--just set the status to needs review in a new comment and testbot will pick it up.
Comment #62
jessebeach commented@xjm, have a look at this CSS Cleanup document that explains the rationale behind .admin.css files
http://drupal.org/node/1089868
Comment #63
jacineAlright... So, I am going to agree with @morten on this one. Sorry @jyve!
You've both got good points, but the main focus is front-end facing code. We could eventually start doing module.admin.base.css and module.admin.theme.css but that'd be a little out of hand right now. That's why there's only one-bucket for administrative CSS right now. Putting that code in .base.css would result in a wasted http request for code that's not going to be needed 80% of the time, so my vote is for .admin.css.
@xjm There's a bunch of discussion on #885228: CSS Files are in major need of clean up! and #777814: Allow modules to provide styles for themes (finally leverage structure/behavior split of CSS files). :)
Comment #64
mortendk commentednow that we have the theme.css file i have added the styles to bartiks style.css
screenshots added for both bartik & stark without theme.css
Comment #65
jyve commentedOk so looks like I lost this one :)
Just looked at your last patch @mortendk, and I wonder why you duplicate the book.theme.css into Bartik? I don't see how this is usefull since it would make Bartik really bloated, or am I missing something here?
Comment #66
mortendk commentedmaybe its a brainfart from my side but shoudnt bartik work & look right without book.theme.css ?
... yeah guess it gets even more bloated ;)
im pretty sure were gonna stomp into more files where we cant figure out if they are base.css or admin.css
Comment #67
mortendk commentedjyve you absolutely right about the bartik css work unessesary bloat offcourse the theme.css will be used when people are using bartik *doh*
here we go its rerolled + i matched the colors so itsnt that ugly gray but the warmer that bartik are using allready. (if thats gonna keep this away from rtbc im gonna scream)
Comment #68
jyve commentedTested the patch in #67, and I think we finally got it right!
Patch looks perfect to me.
Comment #69
mortendk commentedill set it to rtbc ...and do a little happy dance :)
Comment #70
xjmYou can't RTBC your own patch. :P
Comment #71
mortendk commentedi know xjm ;) but was hoping for a silent moment while i was dancing - can you review it
Comment #72
mortendk commentedIm moving the patch over to #736604: book module now without clearfix & better markup + accessibility love and marks this as a duplicate so we can roll the 2 of them together.
Comment #72.0
mortendk commentedAdd CSS Cleanup docs.