UNPKG

3.84 kBSCSSView Raw
1// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
2// Licensed under the Apache License, Version 2.0.
3
4@import "@blueprintjs/core/src/components/forms/common";
5@import "@blueprintjs/core/src/components/icon/icon-mixins";
6@import "../../common";
7
8$timepicker-input-row-height: $pt-grid-size * 3 !default;
9// subtract two because of inset shadow
10$timepicker-input-row-inner-height: $timepicker-input-row-height - 2 !default;
11// helps focus states of inputs line up correctly
12$timepicker-row-padding: 0 1px !default;
13$timepicker-divider-width: $pt-grid-size * 1.1 !default;
14$timepicker-control-width: $pt-grid-size * 3.3 !default;
15
16.#{$ns}-timepicker {
17 white-space: nowrap;
18
19 .#{$ns}-timepicker-arrow-row {
20 padding: $timepicker-row-padding;
21 }
22
23 .#{$ns}-timepicker-arrow-button {
24 @include pt-icon-colors();
25 display: inline-block;
26 padding: ($pt-grid-size * 0.4) 0;
27 text-align: center;
28 width: $timepicker-control-width;
29
30 + .#{$ns}-timepicker-arrow-button {
31 margin-left: $timepicker-divider-width;
32 }
33
34 &:hover {
35 cursor: pointer;
36 }
37 }
38
39 .#{$ns}-timepicker-input-row {
40 background: $input-background-color;
41 border-radius: $pt-border-radius;
42 box-shadow: $pt-input-box-shadow;
43 display: inline-block;
44 height: $timepicker-input-row-height;
45 line-height: $timepicker-input-row-inner-height;
46 padding: $timepicker-row-padding;
47 vertical-align: middle;
48 }
49
50 .#{$ns}-timepicker-divider-text {
51 color: $pt-text-color-muted;
52 display: inline-block;
53 font-size: $pt-font-size-large;
54 text-align: center;
55 width: $timepicker-divider-width;
56 }
57
58 .#{$ns}-timepicker-input {
59 /* stylelint-disable property-no-vendor-prefix */
60 -moz-appearance: textfield;
61 -webkit-appearance: textfield;
62 /* stylelint-enable property-no-vendor-prefix */
63 background: transparent;
64 border: 0;
65 border-radius: $pt-border-radius;
66 box-shadow: input-transition-shadow($input-shadow-color-focus);
67 color: $pt-text-color;
68 height: $timepicker-input-row-inner-height;
69 outline: 0;
70 padding: 0;
71 text-align: center;
72 transition: $input-transition;
73 width: $timepicker-control-width;
74
75 &:focus {
76 box-shadow: input-transition-shadow($input-shadow-color-focus, true);
77 }
78
79 &::-webkit-outer-spin-button,
80 &::-webkit-inner-spin-button {
81 appearance: none;
82 margin: 0;
83 }
84
85
86 @each $intent, $color in $pt-intent-colors {
87 &.#{$ns}-intent-#{$intent} {
88 @include pt-input-intent($color);
89
90 .#{$ns}-dark & {
91 @include pt-dark-input-intent(map-get($pt-dark-input-intent-box-shadow-colors, $intent));
92 }
93 }
94 }
95
96 @media (forced-colors: active) and (prefers-color-scheme: dark) {
97 border: 1px solid $pt-high-contrast-mode-border-color;
98 }
99 }
100
101 .#{$ns}-timepicker-ampm-select {
102 margin-left: $pt-grid-size * 0.5;
103 }
104
105 &.#{$ns}-disabled {
106 .#{$ns}-timepicker-input-row {
107 @include pt-input-disabled();
108 }
109
110 .#{$ns}-timepicker-input,
111 .#{$ns}-timepicker-divider-text {
112 color: $input-color-disabled;
113 cursor: not-allowed;
114 }
115
116 .#{$ns}-timepicker-arrow-button,
117 .#{$ns}-timepicker-arrow-button:hover {
118 color: $input-color-disabled;
119 cursor: not-allowed;
120 }
121 }
122}
123
124.#{$ns}-dark .#{$ns}-timepicker {
125 .#{$ns}-timepicker-input-row {
126 background: $dark-input-background-color;
127 box-shadow: $pt-dark-input-box-shadow;
128 }
129
130 .#{$ns}-timepicker-divider-text {
131 color: $pt-dark-text-color-muted;
132 }
133
134 .#{$ns}-timepicker-input {
135 color: $pt-dark-text-color;
136 }
137
138 &.#{$ns}-disabled {
139 .#{$ns}-timepicker-input,
140 .#{$ns}-timepicker-divider-text,
141 .#{$ns}-timepicker-arrow-button,
142 .#{$ns}-timepicker-arrow-button:hover {
143 color: $dark-input-color-disabled;
144 }
145 }
146}