Skip to content

Instantly share code, notes, and snippets.

@lunule
Forked from SeanTOSCD/wp-buttons.css
Last active December 7, 2023 21:46
Show Gist options
  • Save lunule/916a250bcb04c7ffdbd862852b56c686 to your computer and use it in GitHub Desktop.
Save lunule/916a250bcb04c7ffdbd862852b56c686 to your computer and use it in GitHub Desktop.
WordPress Admin Style Buttons
/*
wp admin style buttons:
To use for links styled as buttons, add a class attribute to the
<a> tag and add "button" as a value. This sets up the basic button
structure. Then you choose which button you want to use. Add a
value of "blue" for the blue button or "gray" for the gray button.
Ex. <a href="#" class="button blue">Blue Button</a>
*/
.button {
display: inline-block;
text-decoration: none;
font-size: 13px;
line-height: 23px;
margin: 0;
padding: 0 10px;
cursor: pointer;
border-width: 1px;
border-style: solid;
-webkit-border-radius: 3px;
-webkit-appearance: none;
border-radius: 3px;
white-space: nowrap;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.blue {
background-color: #21759b;
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
border-color: #21759b;
border-bottom-color: #1e6a8d;
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
color: #fff;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
.blue:hover {
background-color: #278ab7;
background-image: -webkit-gradient(linear,left top,left bottom,from(#2e9fd2),to(#21759b));
background-image: -webkit-linear-gradient(top,#2e9fd2,#21759b);
background-image: -moz-linear-gradient(top,#2e9fd2,#21759b);
background-image: -ms-linear-gradient(top,#2e9fd2,#21759b);
background-image: -o-linear-gradient(top,#2e9fd2,#21759b);
background-image: linear-gradient(to bottom,#2e9fd2,#21759b);
border-color: #1b607f;
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
.gray {
background: #f3f3f3;
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
border-color: #bbb;
color: #333;
text-shadow: 0 1px 0 #fff;
}
.gray:hover {
background: #f3f3f3;
background-image: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#f3f3f3));
background-image: -webkit-linear-gradient(top,#fff,#f3f3f3);
background-image: -moz-linear-gradient(top,#fff,#f3f3f3);
background-image: -ms-linear-gradient(top,#fff,#f3f3f3);
background-image: -o-linear-gradient(top,#fff,#f3f3f3);
background-image: linear-gradient(to bottom,#fff,#f3f3f3);
border-color: #999;
color: #222;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment