You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

inputs.scss 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. /**
  2. * @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com>
  3. * @copyright Copyright (c) 2016, Morris Jobke <hey@morrisjobke.de>
  4. * @copyright Copyright (c) 2016, Joas Schilling <coding@schilljs.com>
  5. * @copyright Copyright (c) 2016, Julius Haertl <jus@bitgrid.net>
  6. * @copyright Copyright (c) 2016, jowi <sjw@gmx.ch>
  7. * @copyright Copyright (c) 2015, Joas Schilling <nickvergessen@owncloud.com>
  8. * @copyright Copyright (c) 2015, Hendrik Leppelsack <hendrik@leppelsack.de>
  9. * @copyright Copyright (c) 2014-2017, Jan-Christoph Borchardt <hey@jancborchardt.net>
  10. *
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. */
  14. /* Specifically override browser styles */
  15. input, textarea, select, button, div[contenteditable=true], div[contenteditable=false] {
  16. font-family: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
  17. }
  18. .select2-container-multi .select2-choices .select2-search-field input, .select2-search input, .ui-widget {
  19. font-family: 'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif !important;
  20. }
  21. /* Simple selector to allow easy overriding */
  22. select,
  23. button,
  24. input,
  25. textarea,
  26. div[contenteditable=true],
  27. div[contenteditable=false] {
  28. width: 130px;
  29. min-height: 32px;
  30. box-sizing: border-box;
  31. }
  32. /* Default global values */
  33. select,
  34. button, .button,
  35. input:not([type='range']),
  36. textarea,
  37. div[contenteditable=true],
  38. .pager li a {
  39. margin: 3px 3px 3px 0;
  40. padding: 7px 6px;
  41. font-size: 13px;
  42. background-color: $color-main-background;
  43. color: nc-lighten($color-main-text, 33%);
  44. border: 1px solid nc-darken($color-main-background, 14%);
  45. outline: none;
  46. border-radius: $border-radius;
  47. cursor: text;
  48. &:not(:disabled):not(.primary) {
  49. &:hover,
  50. &:focus,
  51. &.active {
  52. /* active class used for multiselect */
  53. border-color: $color-primary-element;
  54. outline: none;
  55. }
  56. &:active {
  57. outline: none;
  58. background-color: $color-main-background;
  59. }
  60. }
  61. &:disabled {
  62. background-color: nc-darken($color-main-background, 8%);
  63. color: rgba($color-main-text, 0.4);
  64. cursor: default;
  65. opacity: 0.5;
  66. }
  67. /* Primary action button, use sparingly */
  68. &.primary {
  69. background-color: $color-primary-element;
  70. border: 1px solid $color-primary-text;
  71. color: $color-primary-text;
  72. cursor: pointer;
  73. &:not(:disabled) {
  74. &:hover,
  75. &:focus {
  76. background-color: rgba($color-primary-element, .85);
  77. }
  78. &:active {
  79. background-color: rgba($color-primary-element, .7);
  80. }
  81. }
  82. &:disabled {
  83. background-color: rgba($color-primary-element, .7);
  84. color: nc-lighten($color-main-text, 73%);
  85. }
  86. }
  87. }
  88. div[contenteditable=false] {
  89. margin: 3px 3px 3px 0;
  90. padding: 7px 6px;
  91. font-size: 13px;
  92. background-color: $color-main-background;
  93. color: nc-lighten($color-main-text, 33%);
  94. border: 1px solid nc-darken($color-main-background, 14%);
  95. outline: none;
  96. border-radius: $border-radius;
  97. cursor: text;
  98. background-color: nc-darken($color-main-background, 8%);
  99. color: rgba($color-main-text, 0.4);
  100. cursor: default;
  101. opacity: 0.5;
  102. }
  103. /* Specific override */
  104. input {
  105. &:not([type='radio']):not([type='checkbox']):not([type='range']):not([type='submit']):not([type='button']):not([type='reset']):not([type='color']):not([type='file']):not([type='image']) {
  106. -webkit-appearance: textfield;
  107. -moz-appearance: textfield;
  108. }
  109. &[type='radio'],
  110. &[type='checkbox'],
  111. &[type='file'],
  112. &[type='image'] {
  113. height: auto;
  114. width: auto;
  115. }
  116. /* Color input doesn't respect the initial height
  117. so we need to set a custom one */
  118. &[type='color'] {
  119. margin: 3px;
  120. padding: 0 2px;
  121. min-height: 30px;
  122. width: 40px;
  123. cursor: pointer;
  124. }
  125. &[type='hidden'] {
  126. height: 0;
  127. width: 0;
  128. }
  129. &[type='time'] {
  130. width: initial;
  131. }
  132. }
  133. /* 'Click' inputs */
  134. select,
  135. button, .button,
  136. input[type='button'],
  137. input[type='submit'],
  138. input[type='reset'] {
  139. padding: 6px 12px;
  140. width: auto;
  141. min-height: 34px;
  142. cursor: pointer;
  143. box-sizing: border-box;
  144. background-color: nc-darken($color-main-background, 3%);
  145. }
  146. /* Buttons */
  147. button, .button,
  148. input[type='button'],
  149. input[type='submit'],
  150. input[type='reset'] {
  151. font-weight: bold;
  152. /* Get rid of the ugly firefox dotted line */
  153. &::-moz-focus-inner {
  154. border: 0;
  155. }
  156. }
  157. button, .button {
  158. > span {
  159. /* icon position inside buttons */
  160. &[class^='icon-'],
  161. &[class*=' icon-'] {
  162. display: inline-block;
  163. vertical-align: text-bottom;
  164. opacity: 0.5;
  165. }
  166. }
  167. }
  168. textarea, div[contenteditable=true] {
  169. color: nc-lighten($color-main-text, 33%);
  170. cursor: text;
  171. font-family: inherit;
  172. height: auto;
  173. &:not(:disabled) {
  174. &:active,
  175. &:hover,
  176. &:focus {
  177. border-color: nc-darken($color-main-background, 14%) !important;
  178. background-color: $color-main-background !important;
  179. }
  180. }
  181. }
  182. div[contenteditable=false] {
  183. color: nc-lighten($color-main-text, 33%);
  184. cursor: text;
  185. font-family: inherit;
  186. height: auto;
  187. }
  188. /* Override the ugly select arrow */
  189. select {
  190. -webkit-appearance: none;
  191. -moz-appearance: none;
  192. appearance: none;
  193. background: url('../img/actions/triangle-s.svg') no-repeat right 4px center;
  194. background-color: inherit;
  195. outline: 0;
  196. padding-right: 24px !important;
  197. }
  198. /* Various Fixes */
  199. button img,
  200. .button img {
  201. cursor: pointer;
  202. }
  203. select,
  204. .button.multiselect {
  205. font-weight: 400;
  206. }
  207. /* Radio & Checkboxes */
  208. input {
  209. $color-checkbox-radio-disabled: nc-darken($color-main-background, 27%);
  210. $color-checkbox-radio-border: nc-darken($color-main-background, 47%);
  211. &[type='checkbox'],
  212. &[type='radio'] {
  213. &.radio,
  214. &.checkbox {
  215. position: absolute;
  216. left: -10000px;
  217. top: auto;
  218. width: 1px;
  219. height: 1px;
  220. overflow: hidden;
  221. + label {
  222. user-select: none;
  223. }
  224. &:disabled + label,
  225. &:disabled + label:before {
  226. cursor: default;
  227. }
  228. + label:before {
  229. content: '';
  230. display: inline-block;
  231. height: 12px;
  232. width: 12px;
  233. vertical-align: middle;
  234. border-radius: 50%;
  235. margin: 3px;
  236. margin-top: 1px;
  237. border: 1px solid $color-checkbox-radio-border;
  238. }
  239. &:not(:disabled):not(:checked) + label:hover:before,
  240. &:focus + label:before {
  241. border-color: $color-primary-element;
  242. }
  243. &:checked + label:before,
  244. &.checkbox:indeterminate + label:before {
  245. /* ^ :indeterminate have a strange behavior on radio,
  246. so we respecified the checkbox class again to be safe */
  247. box-shadow: inset 0px 0px 0px 2px $color-main-background;
  248. background-color: $color-primary-element;
  249. border-color: $color-primary-element;
  250. }
  251. &:disabled + label:before {
  252. border: 1px solid $color-checkbox-radio-border;
  253. background-color: $color-checkbox-radio-disabled !important; /* override other status */
  254. }
  255. &:checked:disabled + label:before {
  256. background-color: $color-checkbox-radio-disabled;
  257. }
  258. }
  259. &.checkbox {
  260. + label:before {
  261. border-radius: 1px;
  262. height: 10px;
  263. width: 10px;
  264. box-shadow: none !important;
  265. background-position: center;
  266. }
  267. &:checked + label:before {
  268. background-image: url('../img/actions/checkbox-mark.svg');
  269. }
  270. &:indeterminate + label:before {
  271. background-image: url('../img/actions/checkbox-mixed.svg');
  272. }
  273. }
  274. /* We do not use the nc-darken function as this si not supposed to be changed */
  275. $color-checkbox-radio-white: #fff;
  276. &.radio--white,
  277. &.checkbox--white {
  278. + label:before,
  279. &:focus + label:before {
  280. border-color: darken($color-checkbox-radio-white, 27%);
  281. }
  282. &:not(:disabled):not(:checked) + label:hover:before {
  283. border-color: $color-checkbox-radio-white;
  284. }
  285. &:checked + label:before {
  286. box-shadow: inset 0px 0px 0px 2px $color-main-background;
  287. background-color: darken($color-checkbox-radio-white, 14%);
  288. border-color: darken($color-checkbox-radio-white, 14%);
  289. }
  290. &:disabled + label:before {
  291. background-color: darken($color-checkbox-radio-white, 27%) !important; /* override other status */
  292. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  293. }
  294. &:checked:disabled + label:before {
  295. box-shadow: inset 0px 0px 0px 2px $color-main-background;
  296. border-color: rgba($color-checkbox-radio-white, 0.4) !important; /* override other status */
  297. background-color: darken($color-checkbox-radio-white, 27%);
  298. }
  299. }
  300. &.checkbox--white {
  301. &:checked + label:before,
  302. &:indeterminate + label:before {
  303. background-color: transparent !important; /* Override default checked */
  304. border-color: $color-checkbox-radio-white !important; /* Override default checked */
  305. background-image: url('../img/actions/checkbox-mark-white.svg');
  306. }
  307. &:indeterminate + label:before {
  308. background-image: url('../img/actions/checkbox-mixed-white.svg');
  309. }
  310. &:disabled + label:before {
  311. opacity: 0.7; /* No other choice for white background image */
  312. }
  313. }
  314. }
  315. }
  316. /* Select2 overriding. Merged to core with vendor stylesheet */
  317. .select2-drop {
  318. margin-top: -2px;
  319. background-color: $color-main-background;
  320. &.select2-drop-active {
  321. border-color: nc-darken($color-main-background, 14%);
  322. }
  323. .avatar {
  324. display: inline-block;
  325. margin-right: 8px;
  326. vertical-align: middle;
  327. img {
  328. cursor: pointer;
  329. }
  330. }
  331. .select2-search input {
  332. min-height: auto;
  333. background: url('../img/actions/search.svg') no-repeat right center !important;
  334. background-origin: content-box !important;
  335. }
  336. .select2-results {
  337. max-height: 250px;
  338. margin: 0;
  339. padding: 0;
  340. .select2-result-label {
  341. white-space: nowrap;
  342. overflow: hidden;
  343. text-overflow: ellipsis;
  344. span {
  345. cursor: pointer;
  346. }
  347. }
  348. .select2-result,
  349. .select2-no-results,
  350. .select2-searching {
  351. position: relative;
  352. display: list-item;
  353. padding: 12px;
  354. background-color: transparent;
  355. cursor: pointer;
  356. color: nc-lighten($color-main-text, 33%);
  357. }
  358. .select2-result {
  359. &.select2-selected {
  360. background-color: nc-darken($color-main-background, 3%);
  361. }
  362. }
  363. .select2-highlighted {
  364. background-color: nc-darken($color-main-background, 3%);
  365. color: $color-main-text;
  366. }
  367. }
  368. }
  369. .select2-chosen,
  370. #select2-drop {
  371. .avatar,
  372. .avatar img {
  373. cursor: pointer;
  374. }
  375. }
  376. .select2-container-multi {
  377. .select2-choices,
  378. &.select2-container-active .select2-choices {
  379. box-shadow: none;
  380. white-space: nowrap;
  381. text-overflow: ellipsis;
  382. background: $color-main-background;
  383. color: nc-lighten($color-main-text, 33%);
  384. box-sizing: content-box;
  385. border-radius: $border-radius;
  386. border: 1px solid nc-darken($color-main-background, 14%);
  387. margin: 0;
  388. padding: 2px 0;
  389. min-height: auto;
  390. .select2-search-choice {
  391. line-height: 20px;
  392. padding-left: 5px;
  393. &.select2-search-choice-focus,
  394. &:hover,
  395. &:active,
  396. & {
  397. background-image: none;
  398. background-color: $color-main-background;
  399. color: nc-lighten($color-main-text, 33%);
  400. border: 1px solid nc-darken($color-main-background, 14%);
  401. }
  402. .select2-search-choice-close {
  403. display: none;
  404. }
  405. }
  406. .select2-search-field input {
  407. line-height: 20px;
  408. &.select2-active {
  409. background: none !important;
  410. }
  411. }
  412. }
  413. }
  414. .select2-container {
  415. margin: 3px 3px 3px 0;
  416. &.select2-container-multi .select2-choices {
  417. display: flex;
  418. flex-wrap: wrap;
  419. li {
  420. float: none;
  421. }
  422. }
  423. .select2-choice {
  424. box-shadow: none;
  425. white-space: nowrap;
  426. text-overflow: ellipsis;
  427. background: $color-main-background;
  428. color: nc-lighten($color-main-text, 33%);
  429. box-sizing: content-box;
  430. border-radius: $border-radius;
  431. border: 1px solid nc-darken($color-main-background, 14%);
  432. margin: 0;
  433. padding: 2px 0;
  434. padding-left: 6px;
  435. min-height: auto;
  436. .select2-search-choice {
  437. line-height: 20px;
  438. padding-left: 5px;
  439. background-image: none;
  440. background-color: nc-darken($color-main-background, 3%);
  441. border-color: nc-darken($color-main-background, 3%);
  442. .select2-search-choice-close {
  443. display: none;
  444. }
  445. &.select2-search-choice-focus,
  446. &:hover {
  447. background-color: $color-border;
  448. border-color: $color-border;
  449. }
  450. }
  451. .select2-arrow {
  452. background: none;
  453. border-radius: 0;
  454. border: none;
  455. b {
  456. background: url('../img/actions/triangle-s.svg') no-repeat center !important;
  457. opacity: .5;
  458. }
  459. }
  460. &:hover .select2-arrow b,
  461. &:focus .select2-arrow b,
  462. &:active .select2-arrow b {
  463. opacity: .7;
  464. }
  465. .select2-search-field input {
  466. line-height: 20px;
  467. }
  468. }
  469. }
  470. /* Progressbar */
  471. progress {
  472. display: block;
  473. width: 100%;
  474. padding: 0;
  475. border: 0 none;
  476. background-color: nc-darken($color-main-background, 10%);
  477. border-radius: $border-radius;
  478. flex-basis: 100%;
  479. height: 5px;
  480. overflow: hidden;
  481. &.warn {
  482. &::-moz-progress-bar {
  483. background: $color-error;
  484. }
  485. &::-webkit-progress-value {
  486. background: $color-error;
  487. }
  488. }
  489. &::-webkit-progress-bar {
  490. background: transparent;
  491. }
  492. &::-moz-progress-bar {
  493. border-radius: $border-radius;
  494. background: $color-primary;
  495. transition: 250ms all ease-in-out;
  496. }
  497. &::-webkit-progress-value {
  498. border-radius: $border-radius;
  499. background: $color-primary;
  500. transition: 250ms all ease-in-out;
  501. }
  502. }
  503. /* Animation */
  504. @keyframes shake {
  505. 10%,
  506. 90% {
  507. transform: translate(-1px);
  508. }
  509. 20%,
  510. 80% {
  511. transform: translate(2px);
  512. }
  513. 30%,
  514. 50%,
  515. 70% {
  516. transform: translate(-4px);
  517. }
  518. 40%,
  519. 60% {
  520. transform: translate(4px);
  521. }
  522. }
  523. .shake {
  524. animation-name: shake;
  525. animation-duration: .7s;
  526. animation-timing-function: ease-out;
  527. }