_gf-form.scss 5.9 KB

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