discourse/app/assets/stylesheets/common/components/buttons.css.scss
Régis Hanol a737090442 - FEATURE: revamped poll plugin
- add User.staff scope
- inject MessageBus into Ember views (so it can be used by the poll plugin)
- REFACTOR: use more accurate is_first_post? method instead of post_number == 1
- FEATURE: add support for JSON-typed custom fields
- FEATURE: allow plugins to add validation
- FEATURE: add post_custom_fields to PostSerializer
- FEATURE: allow plugins to whitelist post_custom_fields
- FIX: don't bump when post did not save successfully
- FEATURE: polls are supported in any post
- FEATURE: allow for multiple polls in the same post
- FEATURE: multiple choice polls
- FEATURE: rating polls
- FEATURE: new dialect allowing users to preview polls in the composer
2015-04-23 19:33:29 +02:00

185 lines
3.1 KiB
SCSS

// --------------------------------------------------
// Buttons
// --------------------------------------------------
// Base
// --------------------------------------------------
.btn {
display: inline-block;
margin: 0;
padding: 6px 12px;
font-weight: 500;
font-size: 1em;
line-height: 18px;
text-align: center;
cursor: pointer;
transition: all .25s;
&:active {
text-shadow: none;
}
&[disabled], &.disabled {
cursor: default;
opacity: 0.4;
}
.fa {
margin-right: 7px;
}
&.no-text {
.fa {
margin-right: 0;
line-height: 10px;
}
}
}
.btn.hidden {
display: none;
}
// Default button
// --------------------------------------------------
.btn {
border: none;
color: $primary;
font-weight: normal;
background: dark-light-diff($primary, $secondary, 90%, -65%);
&[href] {
color: $primary;
}
&:hover {
background: dark-light-diff($primary, $secondary, 65%, -75%);
color: #fff;
}
&[disabled] {
background: scale-color-diff();
&:hover { color: scale-color($primary, $lightness: 70%); }
cursor: not-allowed;
}
}
// Buttons used in admin panel
// --------------------------------------------------
.btn-admin {
text-align:left;
}
// Primary button
// --------------------------------------------------
.btn-primary {
border: none;
color: $secondary;
font-weight: normal;
color: #fff;
background: $tertiary;
&[href] {
color: $secondary;
}
&:hover {
color: #fff;
background: scale-color($tertiary, $lightness: -20%);
}
&:active {
@include linear-gradient(scale-color($tertiary, $lightness: -20%), scale-color($tertiary, $lightness: -10%));
color: #fff;
}
&[disabled] {
background: $tertiary;
}
}
// Danger button
// --------------------------------------------------
.btn-danger {
color: $secondary;
font-weight: normal;
background: $danger;
&[href] {
color: $secondary;
}
&:hover{
background: scale-color($danger, $lightness: -20%);
}
&:active {
@include linear-gradient(scale-color($danger, $lightness: -20%), $danger);
}
&[disabled] {
background: $danger;
}
}
// Social buttons
// --------------------------------------------------
.btn-social {
color: $secondary;
text-shadow: 0 1px 0 rgba($primary, 0.2);
box-shadow: inset 0 1px 0 rgba(0,0,0, 0.1);
&[href] {
color: $secondary;
}
&:before {
margin-right: 7px;
font-family: zocial;
line-height: 0.9;
}
&.google, &.google_oauth2 {
background: $google;
&:before {
content: "G";
}
}
&.facebook {
background: $facebook;
&:before {
content: "f";
}
}
&.cas {
background: $cas;
}
&.twitter {
background: $twitter;
&:before {
content: "T";
}
}
&.yahoo {
background: $yahoo;
&:before {
content: "Y";
}
}
&.github {
background: $github;
&:before {
content: "g";
}
}
}
// Button Sizes
// --------------------------------------------------
// Small
.btn-small {
padding: 3px 6px;
font-size: 0.857em;
line-height: 16px;
}
// Large
.btn-large {
padding: 9px 18px;
font-size: 1.143em;
line-height: 20px;
}