Avoid custom CSS in admin



  • In my plugin I write a lot of custom CSS (with LESS) and I do some overrides to speed things up (kind of tight deadline). one example is a custom btn-primary from bootstrap. I'm having a problem where this gets propagated into the admin view. I want to keep everything in the administration panel the way it is. Right now I'm solving it by doing this in my top LESS.file.

    body:not(.admin) {
      @import "buttons";
      @import "help";
      @import "login";
    }
    

    The problem I'm facing is that i can't do something like body { display: none; } in another file since it's a child of that first file. I need to either add the style at the top with no surrounding class (which of course creates a lint problem), or add a class to the very top, like so &.page-login { css }.

    Is there an easier way to just exclude admin from css?

    Thanks!


Log in to reply
 

Suggested Topics

  • 8
  • 2
  • 18
  • 3
  • 2
| |