Dark-Admin icon indicating copy to clipboard operation
Dark-Admin copied to clipboard

Wipe out all wp-admin styles and replace them

Open MichaelArestad opened this issue 9 years ago • 20 comments

Ideally, we'd need between 1-3 new files to replace them all. I'm leaning on one that is heavily componentized in Sass (for max iteration speed). Ultimately, we'd go back to a straight CSS implementation at some point so we won't do too many crazy Sass things.

That said, I'm having a hell of a time figuring out how to get rid of the old styles. Here's where I'm stuck:

image

I'm not super familiar with registering/unregistering all these things and I'm still deciphering the repurposed MP6. I'll take a stab at it tomorrow to see where I end up.

MichaelArestad avatar Aug 28 '15 23:08 MichaelArestad

I'm 100% game to jump in to this with as much time as I can.

Is the initial first step to completely get you back to a blank text/setup and no admin bar or do you want to build on/re-use anything already in place?

DevinVinson avatar Aug 29 '15 00:08 DevinVinson

I'd love to get a completely unstyled canvas with no admin bar styles. Then we can re-add things one section at a time. I want to iterate on many of the current admin styles, but I think it'll be a bit more sane to start with one thing at time.

Ideally, we won't have to add any classes outside of maybe the new components added (heat map).

MichaelArestad avatar Aug 29 '15 00:08 MichaelArestad

Also, thanks for your help!

MichaelArestad avatar Aug 29 '15 00:08 MichaelArestad

I'll poke around for a few and see if I can get that up and running.

DevinVinson avatar Aug 29 '15 00:08 DevinVinson

@DevinVinson Just merged a PR by @egill that got rid of some of the admin bar CSS. There is definitely still some funky styling going on.

MichaelArestad avatar Aug 29 '15 00:08 MichaelArestad

Aside from a few errors it looks like all the styles are cleared out. The red background and a few legacy styles from mp6 are still in place from the plugin itself though.

DevinVinson avatar Aug 29 '15 00:08 DevinVinson

There's still quite a bit of .mp6 in colors-mp6.css (and other references to mp6 as well)

egill avatar Aug 29 '15 01:08 egill

The latest PR removes the references and sets up the new colors css file.

DevinVinson avatar Aug 29 '15 01:08 DevinVinson

Would love to clean the code up according to the coding standard (cough camelcase cough). Probably better to do that sooner rather than later.

egill avatar Aug 29 '15 08:08 egill

Cleaned it up a bit and wrapped it into a class, gets a bit easier to work with. Once you've merged the PR from @DevinVinson I'll submit my cleanup.

egill avatar Aug 29 '15 14:08 egill

We don't have to register Open Sans on our own since it's now a part of core.

egill avatar Aug 29 '15 14:08 egill

Couple of things (well, three):

  1. The CSS for admin-bar is incorrectly set to dark-admin.css
  2. When converting to a class I ran into some issues with wp-login.php, had to "cheat" and initialize wp_styles with $wp_styles = wp_styles(); which kind of leaves a bad taste in my mouth. That function was introduced in 4.2 (way later than the mp6 plugin), might be worth looking into that.
  3. has anything been added to core since the mp6 plugin was conceived that might make things easier?

egill avatar Aug 29 '15 15:08 egill

We don't have to register Open Sans on our own since it's now a part of core.

True. I left that in because I'd like to register Source Sans Pro instead.

We don't have to register Open Sans on our own since it's now a part of core.

I'll arrange a separate stylesheet for admin-bar.

MichaelArestad avatar Aug 29 '15 15:08 MichaelArestad

... that moment where you rebased and committed an older version of your file. Give me a minute, need to clean it up (facepalm) :)

egill avatar Aug 29 '15 18:08 egill

If you want to break things up into additional todos @MichaelArestad I'm game to try and tackle things. I'm not sure how you want to approach things so I'm open to go forward in whatever direction you've got in mind.

DevinVinson avatar Aug 29 '15 22:08 DevinVinson

^^ what he said :)

egill avatar Aug 29 '15 22:08 egill

@DevinVinson Yep. Created an issue of things to tackle. Feel free to add or modify it: https://github.com/MichaelArestad/Dark-Admin/issues/9

MichaelArestad avatar Aug 30 '15 19:08 MichaelArestad

I just saw your tweet. I have always customized the wordpress admin for clients using a child admin-colors folder within the theme and then called it using this function:

function wpt_admin_color_schemes() {

$theme_dir = get_stylesheet_directory_uri();

wp_admin_css_color( 
    'dubs', __( 'Dubs' ),
    $theme_dir . '/admin-colors/dubs/colors.css',
    array( '#3a3a3a', '#1f1f1f', '#528428', '#ffffff' )
);

} add_action('admin_init', 'wpt_admin_color_schemes');

Then you can just select the 'Dubs' (or whatever) color scheme within the user settings. That array of colors is what shows in the user settings, and then you can find your way around the color.css from WP to make adjustments.

I am not too familiar with creating plugins, but I assume this function can be used and you might even be able to work a color selection tool to change colors from site to site. And when Wordpress is updated, it won't overwrite that folder.

Not sure if that helps your cause, but figure I'd share

screen shot 2015-09-01 at 9 36 33 pm

stephenwilli avatar Sep 02 '15 03:09 stephenwilli

@MichaelArestad Designing admin panel theme is not easy. There are several reasons to it, one of the most important is that you don't control the structure.

E.g. some of my recent core contributions are about changing some h3 headings to h2. If you design a theme over structure like this, you'll end up with a lot of grunt work after almost every major update to WP.

ahmadawais avatar Sep 02 '15 04:09 ahmadawais

@ahmadawais Oh I'm aware. I'm hoping we can get away with mostly stylistic changes rather than trying to change too much of the markup with a few exceptions, which we can do in self-contained modules.

MichaelArestad avatar Sep 15 '15 21:09 MichaelArestad