_gf-form.scss 6.5 KB

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