_gf-form.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. }
  104. // Unstyle the caret on `<select>`s in IE10+.
  105. &::-ms-expand {
  106. background-color: transparent;
  107. border: 0;
  108. display: none;
  109. }
  110. &.gf-input-small {
  111. padding: $input-padding-y/3 $input-padding-x/3;
  112. font-size: $font-size-xs;
  113. }
  114. // Customize the `:focus` state to imitate native WebKit styles.
  115. @include form-control-focus();
  116. // Placeholder
  117. &::placeholder {
  118. color: $input-color-placeholder;
  119. opacity: 1;
  120. }
  121. &:disabled,
  122. &[readonly] {
  123. background-color: $input-bg-disabled;
  124. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  125. opacity: 1;
  126. }
  127. &:disabled {
  128. cursor: $cursor-disabled;
  129. }
  130. &.gf-size-auto { width: auto; }
  131. &--dropdown {
  132. padding-right: $input-padding-x*2;
  133. &::after {
  134. position: absolute;
  135. top: 35%;
  136. right: $input-padding-x;
  137. background-color: transparent;
  138. color: $input-color;
  139. font: normal normal normal $font-size-sm/1 FontAwesome;
  140. content: '\f0d7';
  141. pointer-events: none;
  142. }
  143. }
  144. &--small {
  145. padding-top: 4px;
  146. padding-bottom: 4px;
  147. font-size: $font-size-sm;
  148. }
  149. }
  150. .gf-form-hint {
  151. width: 100%;
  152. }
  153. .gf-form-hint-text {
  154. display: block;
  155. text-align: right;
  156. padding-top: 0.5em;
  157. }
  158. .gf-form-select-wrapper {
  159. margin-right: $gf-form-margin;
  160. position: relative;
  161. background-color: $input-bg;
  162. select.gf-form-input {
  163. text-indent: .01px;
  164. text-overflow: '';
  165. padding-right: $input-padding-x*2;
  166. -webkit-appearance: none;
  167. -moz-appearance: menulist-text; // was set to "window" and caused odd display on windos and linux.
  168. appearance: none;
  169. &:-moz-focusring {
  170. outline: none;
  171. color: transparent;
  172. text-shadow: 0 0 0 $text-color;
  173. }
  174. &.ng-empty {
  175. color: $text-color-weak;
  176. }
  177. }
  178. &::after {
  179. position: absolute;
  180. top: 35%;
  181. right: $input-padding-x/2;
  182. background-color: transparent;
  183. color: $input-color;
  184. font: normal normal normal $font-size-sm/1 FontAwesome;
  185. content: '\f0d7';
  186. pointer-events: none;
  187. }
  188. &--has-help-icon {
  189. &::after {
  190. right: $input-padding-x*3;
  191. }
  192. }
  193. }
  194. .gf-form--v-stretch {
  195. align-items: stretch;
  196. }
  197. .gf-form-btn {
  198. padding: $input-padding-y $input-padding-x;
  199. margin-right: $gf-form-margin;
  200. line-height: $input-line-height;
  201. font-size: $font-size-sm;
  202. box-shadow: none;
  203. border: $input-btn-border-width solid transparent;
  204. flex-shrink: 0;
  205. flex-grow: 0;
  206. }
  207. .natural-language-input {
  208. &input[type="number"] {
  209. font-size: $font-size-base;
  210. line-height: $input-line-height;
  211. margin: -6px -5px 0 5px;
  212. padding: $input-padding-y/2 $input-padding-x/2;
  213. }
  214. }
  215. .gf-form-dropdown-typeahead {
  216. margin-right: $gf-form-margin;
  217. position: relative;
  218. background-color: $input-bg;
  219. padding-right: $input-padding-x;
  220. &::after {
  221. position: absolute;
  222. top: 35%;
  223. right: $input-padding-x/2;
  224. background-color: transparent;
  225. color: $input-color;
  226. font: normal normal normal $font-size-sm/1 FontAwesome;
  227. content: '\f0d7';
  228. pointer-events: none;
  229. }
  230. }
  231. .gf-form-help-icon {
  232. flex-grow: 0;
  233. padding-left: $spacer;
  234. color: $text-color-weak;
  235. &--bold {
  236. color: $text-color-emphasis;
  237. padding-left: 0;
  238. }
  239. &--right-absolute {
  240. position: absolute;
  241. right: $spacer;
  242. top: 10px;
  243. }
  244. &--right-normal {
  245. float: right;
  246. }
  247. &--header {
  248. margin-bottom: $gf-form-margin
  249. }
  250. }
  251. select.gf-form-input ~ .gf-form-help-icon {
  252. right: 10px;
  253. }
  254. .gf-form-icon--right-absolute {
  255. position: absolute;
  256. right: $spacer;
  257. top: 10px;
  258. color: $text-muted;
  259. }