Jump to content

AdminOnSteroids css helper to show its a dev site


benbyf
 Share

Recommended Posts

Thought I'd share this quickly as it helps me get to grips with whether I'm looking at the dev site or live site when working on any client project. Dev site only has AdminOnSteroids module. I add the below to sites/templates/admin/admin.css and add that url the admin css field in the module.

Currently only works with default adminTheme.

#masthead{
    background: rgb(153, 12, 94) !important;
}
#logo:before{
    content: 'DEV ';
    color: white;
    margin-right: 1em;
    vertical-align: middle;
    display: inline-block;
    font-size: 1em;
    letter-spacing: 0.05em;
    margin: -15px 0.6em 0em 0;
}

Simply adds a DEV string and changes the header color so I can see I'm on Dev not live. I guess you could do the opposite if you wanted adding content: "LIVE" instead in the CSS.

1931868546_Screenshot2019-04-2310_48_43.thumb.png.2bf4887c9edade02c3b4fbb4c8be28bb.png

  • Like 8
Link to comment
Share on other sites

You can do something similar for the frontend:

body.dev::before {
	content: 'DEV';
	display: block;
	position: fixed;
	bottom: 0;
	left: 0;
	color: white;
	background-color: red;
	padding: 3px;
	font-size: 2rem;
	z-index: 99999;
}

(If you add a body class .dev when in dev mode)

similarly, you could add a few breakpoints, and display stuff like "sm", "m", "l", "xl" so you always know on which viewport you are, while debugging your frontend...

  • Like 4
Link to comment
Share on other sites

  On 4/23/2019 at 9:54 AM, benbyf said:

I add the below to sites/templates/admin/admin.css and add that url the admin css field in the module.

Expand  

Thanks for posting that little trick. I took some inspiration there and made a small module that does the same without AOS. Should work with Default, Reno and Uikit themes. You can enable dev mode in the module's settings or by setting $config->devMode to true in site/config.php. Text and colors can be adapted in module settings.

  Reveal hidden contents

 

  • Like 3
Link to comment
Share on other sites

  On 4/25/2019 at 12:22 PM, BitPoet said:

Thanks for posting that little trick. I took some inspiration there and made a small module that does the same without AOS. Should work with Default, Reno and Uikit themes. You can enable dev mode in the module's settings or by setting $config->devMode to true in site/config.php. Text and colors can be adapted in module settings. 

  Reveal hidden contents

 

Expand  

Wicked! If you happen to stick it up on github I'll use it for sure!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...