_gf-form.scss 5.8 KB

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