_gf-form.scss 5.8 KB

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