source: Application/ocrent/wwwroot/lib/bootstrap/scss/_buttons.scss@ f5f7c24

Last change on this file since f5f7c24 was f5f7c24, checked in by 192011 <mk.snicker@…>, 17 months ago

Initial commit

  • Property mode set to 100644
File size: 6.5 KB
Line 
1//
2// Base styles
3//
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: #{$body-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
23
24 display: inline-block;
25 padding: var(--#{$prefix}btn-padding-y) var(--#{$prefix}btn-padding-x);
26 font-family: var(--#{$prefix}btn-font-family);
27 @include font-size(var(--#{$prefix}btn-font-size));
28 font-weight: var(--#{$prefix}btn-font-weight);
29 line-height: var(--#{$prefix}btn-line-height);
30 color: var(--#{$prefix}btn-color);
31 text-align: center;
32 text-decoration: if($link-decoration == none, null, none);
33 white-space: $btn-white-space;
34 vertical-align: middle;
35 cursor: if($enable-button-pointers, pointer, null);
36 user-select: none;
37 border: var(--#{$prefix}btn-border-width) solid var(--#{$prefix}btn-border-color);
38 @include border-radius(var(--#{$prefix}btn-border-radius));
39 @include gradient-bg(var(--#{$prefix}btn-bg));
40 @include box-shadow(var(--#{$prefix}btn-box-shadow));
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);
48 }
49
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);
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 {
66 box-shadow: var(--#{$prefix}btn-focus-box-shadow);
67 }
68 }
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
74 @if $enable-shadows {
75 box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow);
76 } @else {
77 box-shadow: var(--#{$prefix}btn-focus-box-shadow);
78 }
79 }
80
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
89 background-image: if($enable-gradients, none, null);
90 border-color: var(--#{$prefix}btn-active-border-color);
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);
97 } @else {
98 box-shadow: var(--#{$prefix}btn-focus-box-shadow);
99 }
100 }
101 }
102
103 &:disabled,
104 &.disabled,
105 fieldset:disabled & {
106 color: var(--#{$prefix}btn-disabled-color);
107 pointer-events: none;
108 background-color: var(--#{$prefix}btn-disabled-bg);
109 background-image: if($enable-gradients, none, null);
110 border-color: var(--#{$prefix}btn-disabled-border-color);
111 opacity: var(--#{$prefix}btn-disabled-opacity);
112 @include box-shadow(none);
113 }
114}
115
116
117//
118// Alternate buttons
119//
120
121// scss-docs-start btn-variant-loops
122@each $color, $value in $theme-colors {
123 .btn-#{$color} {
124 @if $color == "light" {
125 @include button-variant(
126 $value,
127 $value,
128 $hover-background: shade-color($value, $btn-hover-bg-shade-amount),
129 $hover-border: shade-color($value, $btn-hover-border-shade-amount),
130 $active-background: shade-color($value, $btn-active-bg-shade-amount),
131 $active-border: shade-color($value, $btn-active-border-shade-amount)
132 );
133 } @else if $color == "dark" {
134 @include button-variant(
135 $value,
136 $value,
137 $hover-background: tint-color($value, $btn-hover-bg-tint-amount),
138 $hover-border: tint-color($value, $btn-hover-border-tint-amount),
139 $active-background: tint-color($value, $btn-active-bg-tint-amount),
140 $active-border: tint-color($value, $btn-active-border-tint-amount)
141 );
142 } @else {
143 @include button-variant($value, $value);
144 }
145 }
146}
147
148@each $color, $value in $theme-colors {
149 .btn-outline-#{$color} {
150 @include button-outline-variant($value);
151 }
152}
153// scss-docs-end btn-variant-loops
154
155
156//
157// Link buttons
158//
159
160// Make a button look and behave like a link
161.btn-link {
162 --#{$prefix}btn-font-weight: #{$font-weight-normal};
163 --#{$prefix}btn-color: #{$btn-link-color};
164 --#{$prefix}btn-bg: transparent;
165 --#{$prefix}btn-border-color: transparent;
166 --#{$prefix}btn-hover-color: #{$btn-link-hover-color};
167 --#{$prefix}btn-hover-border-color: transparent;
168 --#{$prefix}btn-active-color: #{$btn-link-hover-color};
169 --#{$prefix}btn-active-border-color: transparent;
170 --#{$prefix}btn-disabled-color: #{$btn-link-disabled-color};
171 --#{$prefix}btn-disabled-border-color: transparent;
172 --#{$prefix}btn-box-shadow: none;
173 --#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix(color-contrast($primary), $primary, 15%))};
174
175 text-decoration: $link-decoration;
176 @if $enable-gradients {
177 background-image: none;
178 }
179
180 &:hover,
181 &:focus-visible {
182 text-decoration: $link-hover-decoration;
183 }
184
185 &:focus-visible {
186 color: var(--#{$prefix}btn-color);
187 }
188
189 &:hover {
190 color: var(--#{$prefix}btn-hover-color);
191 }
192
193 // No need for an active state here
194}
195
196
197//
198// Button Sizes
199//
200
201.btn-lg {
202 @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
203}
204
205.btn-sm {
206 @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
207}
Note: See TracBrowser for help on using the repository browser.