Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea -...
1
// stylelint-disable selector-no-qualifying-type
-
 
2
 
-
 
3
//
1
//
4
// Base styles
2
// Base styles
5
//
3
//
Línea 6... Línea 4...
6
 
4
 
-
 
5
.btn {
-
 
6
  // scss-docs-start btn-css-vars
-
 
7
  --#{$prefix}btn-padding-x: #{$btn-padding-x};
-
 
8
  --#{$prefix}btn-padding-y: #{$btn-padding-y};
-
 
9
  --#{$prefix}btn-font-family: #{$btn-font-family};
-
 
10
  @include rfs($btn-font-size, --#{$prefix}btn-font-size);
-
 
11
  --#{$prefix}btn-font-weight: #{$btn-font-weight};
-
 
12
  --#{$prefix}btn-line-height: #{$btn-line-height};
-
 
13
  --#{$prefix}btn-color: #{$btn-color};
-
 
14
  --#{$prefix}btn-bg: transparent;
-
 
15
  --#{$prefix}btn-border-width: #{$btn-border-width};
-
 
16
  --#{$prefix}btn-border-color: transparent;
-
 
17
  --#{$prefix}btn-border-radius: #{$btn-border-radius};
-
 
18
  --#{$prefix}btn-hover-border-color: transparent;
-
 
19
  --#{$prefix}btn-box-shadow: #{$btn-box-shadow};
-
 
20
  --#{$prefix}btn-disabled-opacity: #{$btn-disabled-opacity};
-
 
21
  --#{$prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$prefix}btn-focus-shadow-rgb), .5);
-
 
22
  // scss-docs-end btn-css-vars
7
.btn {
23
 
-
 
24
  display: inline-block;
8
  display: inline-block;
25
  padding: var(--#{$prefix}btn-padding-y) var(--#{$prefix}btn-padding-x);
-
 
26
  font-family: var(--#{$prefix}btn-font-family);
9
  font-family: $btn-font-family;
27
  @include font-size(var(--#{$prefix}btn-font-size));
-
 
28
  font-weight: var(--#{$prefix}btn-font-weight);
10
  font-weight: $btn-font-weight;
29
  line-height: var(--#{$prefix}btn-line-height);
11
  color: $body-color;
30
  color: var(--#{$prefix}btn-color);
12
  text-align: center;
31
  text-align: center;
13
  text-decoration: if($link-decoration == none, null, none);
32
  text-decoration: if($link-decoration == none, null, none);
14
  white-space: $btn-white-space;
33
  white-space: $btn-white-space;
-
 
34
  vertical-align: middle;
15
  vertical-align: middle;
35
  cursor: if($enable-button-pointers, pointer, null);
-
 
36
  user-select: none;
16
  user-select: none;
37
  border: var(--#{$prefix}btn-border-width) solid var(--#{$prefix}btn-border-color);
17
  background-color: transparent;
38
  @include border-radius(var(--#{$prefix}btn-border-radius));
18
  border: $btn-border-width solid transparent;
39
  @include gradient-bg(var(--#{$prefix}btn-bg));
19
  @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius);
40
  @include box-shadow(var(--#{$prefix}btn-box-shadow));
Línea -... Línea 41...
-
 
41
  @include transition($btn-transition);
-
 
42
 
-
 
43
  &:hover {
-
 
44
    color: var(--#{$prefix}btn-hover-color);
-
 
45
    text-decoration: if($link-hover-decoration == underline, none, null);
-
 
46
    background-color: var(--#{$prefix}btn-hover-bg);
-
 
47
    border-color: var(--#{$prefix}btn-hover-border-color);
20
  @include transition($btn-transition);
48
  }
-
 
49
 
21
 
50
  .btn-check + &:hover {
-
 
51
    // override for the checkbox/radio buttons
-
 
52
    color: var(--#{$prefix}btn-color);
-
 
53
    background-color: var(--#{$prefix}btn-bg);
-
 
54
    border-color: var(--#{$prefix}btn-border-color);
-
 
55
  }
-
 
56
 
-
 
57
  &:focus-visible {
-
 
58
    color: var(--#{$prefix}btn-hover-color);
22
  @include hover() {
59
    @include gradient-bg(var(--#{$prefix}btn-hover-bg));
-
 
60
    border-color: var(--#{$prefix}btn-hover-border-color);
-
 
61
    outline: 0;
-
 
62
    // Avoid using mixin so we can pass custom focus shadow properly
-
 
63
    @if $enable-shadows {
-
 
64
      box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow);
-
 
65
    } @else {
23
    color: $body-color;
66
      box-shadow: var(--#{$prefix}btn-focus-box-shadow);
Línea 24... Línea 67...
24
    text-decoration: none;
67
    }
25
  }
68
  }
26
 
69
 
-
 
70
  .btn-check:focus-visible + & {
-
 
71
    border-color: var(--#{$prefix}btn-hover-border-color);
-
 
72
    outline: 0;
-
 
73
    // Avoid using mixin so we can pass custom focus shadow properly
27
  &:focus,
74
    @if $enable-shadows {
-
 
75
      box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow);
28
  &.focus {
76
    } @else {
Línea -... Línea 77...
-
 
77
      box-shadow: var(--#{$prefix}btn-focus-box-shadow);
29
    outline: 0;
78
    }
-
 
79
  }
30
    box-shadow: $btn-focus-box-shadow;
80
 
31
  }
81
  .btn-check:checked + &,
-
 
82
  :not(.btn-check) + &:active,
-
 
83
  &:first-child:active,
-
 
84
  &.active,
-
 
85
  &.show {
-
 
86
    color: var(--#{$prefix}btn-active-color);
-
 
87
    background-color: var(--#{$prefix}btn-active-bg);
-
 
88
    // Remove CSS gradients if they're enabled
32
 
89
    background-image: if($enable-gradients, none, null);
-
 
90
    border-color: var(--#{$prefix}btn-active-border-color);
33
  // Disabled comes first so active can properly restyle
91
    @include box-shadow(var(--#{$prefix}btn-active-shadow));
-
 
92
 
-
 
93
    &:focus-visible {
-
 
94
      // Avoid using mixin so we can pass custom focus shadow properly
-
 
95
      @if $enable-shadows {
-
 
96
        box-shadow: var(--#{$prefix}btn-active-shadow), var(--#{$prefix}btn-focus-box-shadow);
34
  &.disabled,
97
      } @else {
Línea 35... Línea 98...
35
  &:disabled {
98
        box-shadow: var(--#{$prefix}btn-focus-box-shadow);
36
    opacity: $btn-disabled-opacity;
99
      }
37
    @include box-shadow(none);
-
 
38
  }
-
 
39
 
100
    }
40
  &:not(:disabled):not(.disabled) {
101
  }
41
    cursor: if($enable-pointer-cursor-for-buttons, pointer, null);
-
 
42
 
102
 
43
    &:active,
103
  .btn-check:checked:focus-visible + & {
44
    &.active {
-
 
45
      @include box-shadow($btn-active-box-shadow);
104
    // Avoid using mixin so we can pass custom focus shadow properly
46
 
105
    @if $enable-shadows {
47
      &:focus {
-
 
Línea 48... Línea 106...
48
        @include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow);
106
      box-shadow: var(--#{$prefix}btn-active-shadow), var(--#{$prefix}btn-focus-box-shadow);
49
      }
107
    } @else {
50
    }
108
      box-shadow: var(--#{$prefix}btn-focus-box-shadow);
-
 
109
    }
51
  }
110
  }
-
 
111
 
-
 
112
  &:disabled,
-
 
113
  &.disabled,
-
 
114
  fieldset:disabled & {
-
 
115
    color: var(--#{$prefix}btn-disabled-color);
-
 
116
    pointer-events: none;
52
}
117
    background-color: var(--#{$prefix}btn-disabled-bg);
Línea 53... Línea 118...
53
 
118
    background-image: if($enable-gradients, none, null);
54
// Future-proof disabling of clicks on `<a>` elements
119
    border-color: var(--#{$prefix}btn-disabled-border-color);
55
a.btn.disabled,
120
    opacity: var(--#{$prefix}btn-disabled-opacity);
Línea -... Línea 121...
-
 
121
    @include box-shadow(none);
56
fieldset:disabled a.btn {
122
  }
57
  pointer-events: none;
123
}
-
 
124
 
-
 
125
 
-
 
126
//
-
 
127
// Alternate buttons
-
 
128
//
-
 
129
 
-
 
130
// scss-docs-start btn-variant-loops
-
 
131
@each $color, $value in $theme-colors {
-
 
132
  .btn-#{$color} {
-
 
133
    @if $color == "light" {
-
 
134
      @include button-variant(
-
 
135
        $value,
-
 
136
        $value,
-
 
137
        $hover-background: shade-color($value, $btn-hover-bg-shade-amount),
-
 
138
        $hover-border: shade-color($value, $btn-hover-border-shade-amount),
-
 
139
        $active-background: shade-color($value, $btn-active-bg-shade-amount),
-
 
140
        $active-border: shade-color($value, $btn-active-border-shade-amount)
-
 
141
      );
-
 
142
    } @else if $color == "dark" {
58
}
143
      @include button-variant(
-
 
144
        $value,
59
 
145
        $value,
60
 
146
        $hover-background: tint-color($value, $btn-hover-bg-tint-amount),
Línea 61... Línea 147...
61
//
147
        $hover-border: tint-color($value, $btn-hover-border-tint-amount),
62
// Alternate buttons
148
        $active-background: tint-color($value, $btn-active-bg-tint-amount),
63
//
149
        $active-border: tint-color($value, $btn-active-border-tint-amount)
64
 
150
      );
65
@each $color, $value in $theme-colors {
151
    } @else {
-
 
152
      @include button-variant($value, $value);
Línea 66... Línea 153...
66
  .btn-#{$color} {
153
    }
67
    @include button-variant($value, $value);
154
  }
68
  }
155
}
Línea 69... Línea 156...
69
}
156
 
70
 
157
@each $color, $value in $theme-colors {
71
@each $color, $value in $theme-colors {
158
  .btn-outline-#{$color} {
72
  .btn-outline-#{$color} {
159
    @include button-outline-variant($value);
-
 
160
  }
-
 
161
}
-
 
162
// scss-docs-end btn-variant-loops
-
 
163
 
-
 
164
 
-
 
165
//
-
 
166
// Link buttons
-
 
167
//
-
 
168
 
-
 
169
// Make a button look and behave like a link
-
 
170
.btn-link {
73
    @include button-outline-variant($value);
171
  --#{$prefix}btn-font-weight: #{$font-weight-normal};
-
 
172
  --#{$prefix}btn-color: #{$btn-link-color};
-
 
173
  --#{$prefix}btn-bg: transparent;
-
 
174
  --#{$prefix}btn-border-color: transparent;
Línea 74... Línea 175...
74
  }
175
  --#{$prefix}btn-hover-color: #{$btn-link-hover-color};
75
}
176
  --#{$prefix}btn-hover-border-color: transparent;
76
 
177
  --#{$prefix}btn-active-color: #{$btn-link-hover-color};
77
 
178
  --#{$prefix}btn-active-border-color: transparent;
Línea 78... Línea -...
78
//
-
 
79
// Link buttons
179
  --#{$prefix}btn-disabled-color: #{$btn-link-disabled-color};
80
//
180
  --#{$prefix}btn-disabled-border-color: transparent;
81
 
181
  --#{$prefix}btn-box-shadow: 0 0 0 #000; // Can't use `none` as keyword negates all values when used with multiple shadows
Línea 82... Línea -...
82
// Make a button look and behave like a link
-
 
83
.btn-link {
182
  --#{$prefix}btn-focus-shadow-rgb: #{$btn-link-focus-shadow-rgb};
84
  font-weight: $font-weight-normal;
183
 
85
  color: $link-color;
-
 
86
  text-decoration: $link-decoration;
184
  text-decoration: $link-decoration;
Línea 87... Línea 185...
87
 
185
  @if $enable-gradients {
88
  @include hover() {
186
    background-image: none;
Línea 108... Línea 206...
108
//
206
//
109
// Button Sizes
207
// Button Sizes
110
//
208
//
Línea 111... Línea 209...
111
 
209
 
112
.btn-lg {
210
.btn-lg {
113
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
211
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
Línea 114... Línea 212...
114
}
212
}
115
 
213
 
116
.btn-sm {
-
 
117
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
-
 
118
}
-
 
119
 
-
 
120
 
-
 
121
//
-
 
122
// Block button
-
 
123
//
-
 
124
 
-
 
125
.btn-block {
-
 
126
  display: block;
-
 
127
  width: 100%;
-
 
128
 
-
 
129
  // Vertically space out multiple block buttons
-
 
130
  + .btn-block {
-
 
131
    margin-top: $btn-block-spacing-y;
-
 
132
  }
-
 
133
}
-
 
134
 
-
 
135
// Specificity overrides
-
 
136
input[type="submit"],
-
 
137
input[type="reset"],
-
 
138
input[type="button"] {
-
 
139
  &.btn-block {
-
 
140
    width: 100%;
214
.btn-sm {