inputs.scss 12 KB

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