Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// stylelint-disable selector-no-qualifying-type
2
 
3
// Make the div behave like a button
4
.btn-group,
5
.btn-group-vertical {
6
  position: relative;
7
  display: inline-flex;
8
  align-items: center;
9
 
10
  > .btn {
11
    position: relative;
12
    flex: 1 1 auto;
13
 
14
    // Bring the hover, focused, and "active" buttons to the front to overlay
15
    // the borders properly
16
    @include hover() {
17
      z-index: 1;
18
    }
19
    &:focus,
20
    &:active,
21
    &.active {
22
      z-index: 1;
23
    }
24
  }
25
}
26
 
27
// Optional: Group multiple button groups together for a toolbar
28
.btn-toolbar {
29
  display: flex;
30
  flex-wrap: wrap;
31
  justify-content: flex-start;
32
 
33
  .input-group {
34
    width: auto;
35
  }
36
}
37
 
38
.btn-group {
39
  // Prevent double borders when buttons are next to each other
40
  > .btn:not(:first-child),
41
  > .btn-group:not(:first-child) {
42
    margin-left: -$btn-border-width;
43
  }
44
 
45
  // Reset rounded corners
46
  > .btn:not(:last-child):not(.dropdown-toggle),
47
  > .btn-group:not(:last-child) > .btn {
48
    @include border-right-radius(0);
49
  }
50
 
51
  > .btn:not(:first-child),
52
  > .btn-group:not(:first-child) > .btn {
53
    @include border-left-radius(0);
54
  }
55
 
56
  > .btn:first-child {
57
    @include border-left-radius($btn-border-radius);
58
  }
59
 
60
  > .btn:last-child {
61
    @include border-right-radius($btn-border-radius);
62
  }
63
 
64
  .btn {
65
    &.active {
66
      background-color: $primary-color-100;
67
      color: $primary-color-600;
68
 
69
      .theme-dark & {
70
          background-color: $dm-gray-300;
71
          color: $dm-gray-800;
72
      }
73
    }
74
 
75
    &:hover {
76
        background-color: $gray-100;
77
        color: $primary-color-600;
78
 
79
        .theme-dark & {
80
            background-color: $dm-gray-100;
81
            color: $primary-color-100;
82
        }
83
    }
84
  }
85
 
86
}
87
 
88
// Sizing
89
//
90
// Remix the default button sizing classes into new ones for easier manipulation.
91
 
92
.btn-group-sm > .btn { @extend .btn-sm; }
93
.btn-group-lg > .btn { @extend .btn-lg; }
94
 
95
 
96
//
97
// Split button dropdowns
98
//
99
 
100
.dropdown-toggle-split {
101
  padding-right: $btn-padding-x * .75;
102
  padding-left: $btn-padding-x * .75;
103
 
104
  &::after,
105
  .dropup &::after,
106
  .dropright &::after {
107
    margin-left: 0;
108
  }
109
 
110
  .dropleft &::before {
111
    margin-right: 0;
112
  }
113
}
114
 
115
.btn-sm + .dropdown-toggle-split {
116
  padding-right: $btn-padding-x-sm * .75;
117
  padding-left: $btn-padding-x-sm * .75;
118
}
119
 
120
.btn-lg + .dropdown-toggle-split {
121
  padding-right: $btn-padding-x-lg * .75;
122
  padding-left: $btn-padding-x-lg * .75;
123
}
124
 
125
 
126
// The clickable button for toggling the menu
127
// Set the same inset shadow as the :active state
128
.btn-group.show .dropdown-toggle {
129
  @include box-shadow($btn-active-box-shadow);
130
 
131
  // Show no shadow for `.btn-link` since it has no other button styles.
132
  &.btn-link {
133
    @include box-shadow(none);
134
  }
135
}
136
 
137
 
138
//
139
// Vertical button groups
140
//
141
 
142
.btn-group-vertical {
143
  flex-direction: column;
144
  align-items: flex-start;
145
  justify-content: center;
146
 
147
  > .btn,
148
  > .btn-group {
149
    width: 100%;
150
  }
151
 
152
  > .btn:not(:first-child),
153
  > .btn-group:not(:first-child) {
154
    margin-top: -$btn-border-width;
155
  }
156
 
157
  // Reset rounded corners
158
  > .btn:not(:last-child):not(.dropdown-toggle),
159
  > .btn-group:not(:last-child) > .btn {
160
    @include border-bottom-radius(0);
161
  }
162
 
163
  > .btn:not(:first-child),
164
  > .btn-group:not(:first-child) > .btn {
165
    @include border-top-radius(0);
166
  }
167
}
168
 
169
 
170
// Checkbox and radio options
171
//
172
// In order to support the browser's form validation feedback, powered by the
173
// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
174
// `display: none;` or `visibility: hidden;` as that also hides the popover.
175
// Simply visually hiding the inputs via `opacity` would leave them clickable in
176
// certain cases which is prevented by using `clip` and `pointer-events`.
177
// This way, we ensure a DOM element is visible to position the popover from.
178
//
179
// See https://github.com/twbs/bootstrap/pull/12794 and
180
// https://github.com/twbs/bootstrap/pull/14559 for more information.
181
 
182
.btn-group-toggle {
183
  > .btn,
184
  > .btn-group > .btn {
185
    margin-bottom: 0; // Override default `<label>` value
186
 
187
    input[type="radio"],
188
    input[type="checkbox"] {
189
      position: absolute;
190
      clip: rect(0, 0, 0, 0);
191
      pointer-events: none;
192
    }
193
  }
194
}