_gf-form.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. $gf-form-margin: 3px;
  2. $input-border: 1px solid $input-border-color;
  3. .gf-form {
  4. margin-bottom: $gf-form-margin;
  5. display: flex;
  6. flex-direction: row;
  7. align-items: center;
  8. text-align: left;
  9. position: relative;
  10. &--offset-1 {
  11. margin-left: $spacer;
  12. }
  13. &--grow {
  14. flex-grow: 1;
  15. }
  16. &--flex-end {
  17. justify-content: flex-end;
  18. }
  19. &--alt {
  20. flex-direction: column;
  21. align-items: flex-start;
  22. .gf-form-label {
  23. padding: 4px 0;
  24. }
  25. }
  26. }
  27. .gf-form--has-input-icon {
  28. position: relative;
  29. .gf-form-input-icon {
  30. position: absolute;
  31. top: 50%;
  32. margin-top: -9px;
  33. font-size: $font-size-lg;
  34. left: 10px;
  35. color: $input-color-placeholder;
  36. }
  37. > input {
  38. padding-left: 35px;
  39. &:focus + .gf-form-input-icon {
  40. color: $text-muted;
  41. }
  42. }
  43. }
  44. .gf-form-disabled {
  45. color: $text-color-weak;
  46. .gf-form-select-wrapper::after {
  47. color: $text-color-weak;
  48. }
  49. a,
  50. .gf-form-input {
  51. color: $text-color-weak;
  52. }
  53. }
  54. .gf-form-group {
  55. margin-bottom: $spacer * 2.5;
  56. }
  57. .gf-form-inline {
  58. display: flex;
  59. flex-direction: row;
  60. flex-wrap: wrap;
  61. align-content: flex-start;
  62. .gf-form + .gf-form {
  63. margin-right: $gf-form-margin;
  64. }
  65. }
  66. .gf-form-button-row {
  67. padding-top: $spacer * 1.5;
  68. a,
  69. button {
  70. margin-right: $spacer;
  71. }
  72. }
  73. .gf-form-label {
  74. padding: $input-padding-y $input-padding-x;
  75. flex-shrink: 0;
  76. font-weight: $font-weight-semi-bold;
  77. font-size: $font-size-sm;
  78. background-color: $input-label-bg;
  79. display: block;
  80. border: $input-btn-border-width solid $input-label-border-color;
  81. border-right: none;
  82. border-radius: $label-border-radius;
  83. &--grow {
  84. flex-grow: 1;
  85. min-height: 2.6rem;
  86. }
  87. &--error {
  88. color: $critical;
  89. }
  90. }
  91. .gf-form-label + .gf-form-label {
  92. margin-right: $gf-form-margin;
  93. }
  94. .gf-form-pre {
  95. display: block;
  96. flex-grow: 1;
  97. margin: 0;
  98. margin-right: $gf-form-margin;
  99. border: $input-btn-border-width solid transparent;
  100. border-left: none;
  101. @include border-radius($label-border-radius-sm);
  102. }
  103. .gf-form-checkbox {
  104. flex-shrink: 0;
  105. padding: $input-padding-y $input-padding-x;
  106. line-height: $input-line-height;
  107. .checkbox-label {
  108. display: inline;
  109. cursor: pointer;
  110. padding: $input-padding-y 0.4rem;
  111. line-height: $input-line-height;
  112. }
  113. }
  114. .gf-form-textarea {
  115. max-width: 650px;
  116. }
  117. .gf-form-input {
  118. display: block;
  119. width: 100%;
  120. padding: $input-padding-y $input-padding-x;
  121. margin-right: $gf-form-margin;
  122. font-size: $font-size-md;
  123. line-height: $input-line-height;
  124. color: $input-color;
  125. background-color: $input-bg;
  126. background-image: none;
  127. background-clip: padding-box;
  128. border: $input-border;
  129. border-radius: $input-border-radius;
  130. @include box-shadow($input-box-shadow);
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. // text areas should be scrollable
  135. @at-root textarea#{&} {
  136. overflow: auto;
  137. white-space: pre-wrap;
  138. }
  139. // Unstyle the caret on `<select>`s in IE10+.
  140. &::-ms-expand {
  141. background-color: transparent;
  142. border: 0;
  143. display: none;
  144. }
  145. &.gf-input-small {
  146. padding: $input-padding-y/3 $input-padding-x/3;
  147. font-size: $font-size-xs;
  148. }
  149. // Customize the `:focus` state to imitate native WebKit styles.
  150. @include form-control-focus();
  151. // Placeholder
  152. &::placeholder {
  153. color: $input-color-placeholder;
  154. opacity: 1;
  155. }
  156. &:disabled,
  157. &[readonly] {
  158. background-color: $input-bg-disabled;
  159. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  160. opacity: 1;
  161. }
  162. &:disabled {
  163. cursor: $cursor-disabled;
  164. }
  165. &.gf-size-auto {
  166. width: auto;
  167. }
  168. &--dropdown {
  169. padding-right: $input-padding-x*2;
  170. &::after {
  171. position: absolute;
  172. top: 36%;
  173. right: 11px;
  174. font-size: 11px;
  175. background-color: transparent;
  176. color: $text-color;
  177. font: normal normal normal $font-size-sm/1 FontAwesome;
  178. content: "\f0d7";
  179. pointer-events: none;
  180. }
  181. }
  182. &--small {
  183. padding-top: 4px;
  184. padding-bottom: 4px;
  185. font-size: $font-size-sm;
  186. }
  187. &--plaintext {
  188. white-space: unset;
  189. }
  190. }
  191. .gf-form-hint {
  192. width: 100%;
  193. }
  194. .gf-form-hint-text {
  195. display: block;
  196. text-align: right;
  197. padding-top: 0.5em;
  198. }
  199. .gf-form-select-wrapper {
  200. margin-right: $gf-form-margin;
  201. position: relative;
  202. background-color: $input-bg;
  203. select.gf-form-input {
  204. text-indent: 0.01px;
  205. text-overflow: "";
  206. padding-right: $input-padding-x*4;
  207. -webkit-appearance: none;
  208. -moz-appearance: menulist-text; // was set to "window" and caused odd display on windos and linux.
  209. appearance: none;
  210. &:-moz-focusring {
  211. outline: none;
  212. color: transparent;
  213. text-shadow: 0 0 0 $text-color;
  214. }
  215. &.ng-empty {
  216. color: $text-color-weak;
  217. }
  218. }
  219. &::after {
  220. position: absolute;
  221. top: 36%;
  222. right: 11px;
  223. background-color: transparent;
  224. color: $text-color;
  225. font: normal normal normal $font-size-sm/1 FontAwesome;
  226. content: "\f0d7";
  227. pointer-events: none;
  228. font-size: 11px;
  229. }
  230. &--has-help-icon {
  231. &::after {
  232. right: $input-padding-x*3;
  233. }
  234. }
  235. }
  236. .gf-form--v-stretch {
  237. align-items: stretch;
  238. }
  239. .gf-form-btn {
  240. padding: $input-padding-y $input-padding-x;
  241. margin-right: $gf-form-margin;
  242. line-height: $input-line-height;
  243. font-size: $font-size-sm;
  244. flex-shrink: 0;
  245. flex-grow: 0;
  246. }
  247. .natural-language-input {
  248. &input[type="number"] {
  249. font-size: $font-size-base;
  250. line-height: $input-line-height;
  251. margin: -6px -5px 0 5px;
  252. padding: $input-padding-y/2 $input-padding-x/2;
  253. }
  254. }
  255. .gf-form-dropdown-typeahead {
  256. margin-right: $gf-form-margin;
  257. position: relative;
  258. background-color: $input-bg;
  259. padding-right: $input-padding-x;
  260. border: $input-border;
  261. border-radius: $input-border-radius;
  262. &::after {
  263. position: absolute;
  264. top: 35%;
  265. right: $input-padding-x/2;
  266. background-color: transparent;
  267. color: $input-color;
  268. font: normal normal normal $font-size-sm/1 FontAwesome;
  269. content: "\f0d7";
  270. pointer-events: none;
  271. }
  272. .gf-form-input {
  273. border: none;
  274. }
  275. }
  276. .gf-form-help-icon {
  277. flex-grow: 0;
  278. padding-left: $spacer;
  279. color: $text-color-weak;
  280. &--bold {
  281. color: $text-color-emphasis;
  282. padding-left: 0;
  283. }
  284. &--right-absolute {
  285. position: absolute;
  286. right: $spacer;
  287. top: 10px;
  288. }
  289. &--right-normal {
  290. float: right;
  291. }
  292. &--header {
  293. margin-bottom: $gf-form-margin;
  294. }
  295. }
  296. select.gf-form-input ~ .gf-form-help-icon {
  297. right: 10px;
  298. }
  299. .gf-form-icon--right-absolute {
  300. position: absolute;
  301. right: $spacer;
  302. top: 10px;
  303. color: $text-muted;
  304. }