It is intended to replace default WordPress styling and to help us unify all our plugins.
- To start include dist/wp-admin-style.css
- Wrap your content with wp-admin-style class
<div class="wp-admin-style">
// Your code here
</div>
or attach wp-admin-style to the body
<body class="wp-admin-style">
// Your code here
</body>
WordPress Filter to attach the body class
function wpast_body_classes( $classes ) {
global $post;
$classes[] = 'wp_admin_style'; // add custom class to all single posts
// if ( is_singular( 'post' ) ) {
// $classes[] = 'wp_admin_style'; // add custom class to all single posts
// }
// if ( is_singular( 'page' ) ) {
// $classes[] = 'wp_admin_style'; // add custom class to all single pages
// }
// if ( is_singular( 'customposttype' ) ) { // change customposttype to your CPT slug
// $classes[] = 'wp_admin_style'; // add custom class to all single custom post types
// }
// if ( is_home() ) {
// $classes[] = 'wp_admin_style'; // add custom class to blog homepage
// }
// if ( is_front_page() ) {
// $classes[] = 'wp_admin_style'; // add custom class to blog static page frontpage
// }
// if ( is_archive() ) {
// $classes[] = 'wp_admin_style'; // add custom class to archive pages
// }
return $classes;
}
add_filter( 'body_class', 'wpast_body_classes' );
Front end framework for websites. We do not want to bloat it with bells and whistles that the website needs. We want to optimize components for only WordPress plugins' backend.