Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buttons.scss « sass - github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7abec8a025e79106e416ba68f84c98113d141703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//
// Buttons
// --------------------------------------------------

.btn {
  position: relative;
  display: inline-block;
  padding: 6px 8px 7px;
  margin-bottom: 0; // For input.btn
  font-size: $button-font-size;
  font-weight: $font-weight-light;
  line-height: 1;
  color: #333;
  text-align: center;
  white-space: nowrap;
  vertical-align: top;
  cursor: pointer;
  background-color: $chrome-color;
  border: 1px solid #ccc;
  border-radius: 3px;

  // Active & filled button styles
  &:active,
  &.active {
    color: inherit; // Overriding the gloabl style for all anchors.
    background-color: #ccc;
  }

  // Disabled styles & filled button active styles
  &:disabled,
  &.disabled {
    opacity: .6;
  }
}


// Other button types
// --------------------------------------------------

// Primary button (Default color is blue)
.btn-primary {
  color: #fff;
  background-color: $primary-color;
  border: 1px solid $primary-color;

  &:active,
  &.active {
    color: #fff;
    background-color: darken($primary-color, 10%);
    border: 1px solid darken($primary-color, 10%);
  }
}

// Positive button (Default color is green)
.btn-positive {
  color: #fff;
  background-color: $positive-color;
  border: 1px solid $positive-color;

  &:active,
  &.active {
    color: #fff;
    background-color: darken($positive-color, 10%);
    border: 1px solid darken($positive-color, 10%);
  }
}

// Negative button (Default color is red)
.btn-negative {
  color: #fff;
  background-color: $negative-color;
  border: 1px solid $negative-color;

  &:active,
  &.active {
    color: #fff;
    background-color: darken($negative-color, 10%);
    border: 1px solid darken($negative-color, 10%);
  }
}

// Outlined buttons
.btn-outlined {
  background-color: transparent;

  &.btn-primary {
    color: $primary-color;
  }
  &.btn-positive {
    color: $positive-color;
  }
  &.btn-negative {
    color: $negative-color;
  }
  // Active states
  &.btn-primary:active,
  &.btn-positive:active,
  &.btn-negative:active {
    color: #fff;
  }
}

// Link button (Buttons that look like links)
.btn-link {
  padding-top: 6px;
  padding-bottom: 6px;
  color: $primary-color;
  background-color: transparent;
  border: 0;

  &:active,
  &.active {
    color: darken($primary-color, 10%);
    background-color: transparent;
  }
}

// Block level buttons (full width buttons)
.btn-block {
  display: block;
  width: 100%;
  padding: 15px 0;
  margin-bottom: 10px;
  font-size: 18px;
}


// Button overrides
// --------------------------------------------------

input[type="submit"],
input[type="reset"],
input[type="button"] {
  width: 100%;
}


// Buttons with badges
// --------------------------------------------------

// Generic styles for all badges within default buttons
.btn .badge {
  margin: -2px -4px -2px 4px;
  font-size: 12px;
  background-color: rgba(0,0,0,.15);
}

// Buttons with inverted badges
.btn .badge-inverted,
.btn:active .badge-inverted {
  background-color: transparent;
}
.btn-primary:active .badge-inverted,
.btn-positive:active .badge-inverted,
.btn-negative:active .badge-inverted {
  color: #fff;
}

// Position badges within block level buttons
// Note: These are absolutely positioned so that text of button isn't "pushed" by badge and always
// stays at the center of button
.btn-block .badge {
  position: absolute;
  right: 0;
  margin-right: 10px;
}


// Buttons with Ratchicons
// --------------------------------------------------

.btn .icon {
  font-size: inherit;
}