_gf-form.scss 6.1 KB

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