WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Why is wp-admin.css all one long line!? (7 posts)

  1. CiderJack
    Member
    Posted 2 years ago #

    I want to re-theme the login page so it ties in more cleanly with the main site, and I think I've discovered why I haven't seen this done very often... Allofthewp-admincssfilesareeachwrittenoutinonelonglinethatmakesitveryverydifficulttoedit!

    Anyone know why the heck this is done this way? As I understand, the point of doing that is to deter people from easily editing the code, which seems to be the very antithesis of WP!

    Are there any simple tricks to break it up to separate each line to properly format it the way it SHOULD be? Or has someone already done this and is/are the file(s) available for download?

  2. playing2012
    Member
    Posted 2 years ago #

    I know this is a very old post but to answer your question for other users, you need to de-minify the file using tools like on this link:

    http://minify.avivo.si/#results

    Step 1: Select CSS from the drop-down list;
    Step 2: Select Beautify;
    step 3: Paste your code in the white box;
    Step 4: Click on Generate

    Hope this helps.

  3. CiderJack
    Member
    Posted 2 years ago #

    Awesome playing2012, that did the trick! :D

  4. Sigh. PLEASE don't hack core. That includes changing the admin stylesheets, not just core php files. Just don't. The very best outcome is that you'll lose all your work the next time you update WP.

    Instead, create a stylesheet that makes the changes you want, and enqueue it properly. Your changes will override the original stylesheet - that's the "Cascade" part of Cascading Style Sheets. The Blue Admin Bar plugin does something similar, if you need to see an example.

    If that doesn't sound up your alley, the Theme My Login plugin will allow you to theme your login pages (and a whole lot more than that).

    (And just a quick note on the style minification in core: It's not done to obscure or deter anything. Both scripts and styles are minified - that is, turned into one big line - just as they are in most major web apps, because it saves anywhere from 1/3 to 1/2 of the bandwidth and load time for those files.)

  5. CiderJack
    Member
    Posted 2 years ago #

    Even more awesome, Amy! TY!

    This is what I had really been hoping for, an explanation for why it had been done this way, and an appropriate workaround.

    Anyway, I had never heard any of this before and I've been working off-and-on with WP for several years now. Sorry if it made you feel a "sigh" was important to include in your (extremely-informative-and-helpful) reply.

    I'd like to add that having the ability to de-minify it lets me see what the heck was being done so I know what code needs to be changed where in my own stylesheet. Will likely save me (and others) a ton of time! I would put forward that the "hack" is still a totally valid tool for WP development, even if the de-minified code won't be uploaded to the production server. I'm still no less grateful to playing2012 for answering the other half of my question.

    Cheers

  6. You're welcome! And about the "sigh" - it wasn't directed at you personally, so much as at how often I end up saying it; sorry if it came off a little too on-target.

    Now, as for being able to see non-minified CSS, there's no need to go to any outside tools for that. The readable versions are right there for you: if you look in the core CSS folder you were playing with earlier, you'll find the dev CSS files like wp-admin.dev.css, media.dev.css etc. Those are the files the core devs actually work on, and thn the compressed versions are created by a script when the zip is made. As you said in your original post, it wouldn't be very WP-like to actually keep that info from you!

  7. CiderJack
    Member
    Posted 2 years ago #

    Amy, you're a regular fountain of useful info!

    Clearly I wasn't aware of the .dev.css files... geez I'm shot back from feeling like I knew something about what I was doing to being a total noob. This will continue to repeat itself for awhile I'm sure. (I hope I'm allowed a 'sigh' here) ;)

    Knowing the .dev.css files are the same as the original actually trumps playing2012's advice IMHO (which I have a feeling more people go that route (or give up) than know about the .dev files).

    Delving into the Codex for real this time, I think I've got alot of studying to do...

    Thanks again... I think... ;)

Topic Closed

This topic has been closed to new replies.

About this Topic