_Widget.scss 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /* ==========================================================================
  2. box-sizing
  3. ========================================================================== */
  4. @mixin widget {
  5. .esri-widget {
  6. box-sizing: border-box;
  7. color: $font-color;
  8. font-size: $font-size;
  9. font-family: $font-family;
  10. line-height: $line-height;
  11. background-color: $background-color;
  12. *,
  13. *:before,
  14. *:after {
  15. box-sizing: inherit;
  16. }
  17. &#{&}--disabled {
  18. & > * {
  19. pointer-events: none;
  20. opacity: $opacity--disabled;
  21. }
  22. }
  23. }
  24. .esri-widget__anchor {
  25. text-decoration: none;
  26. color: $button-color;
  27. &:hover {
  28. color: $button-color--hover;
  29. }
  30. &--disabled {
  31. pointer-events: none;
  32. opacity: $opacity--disabled;
  33. }
  34. &:hover,
  35. &:focus {
  36. text-decoration: underline;
  37. }
  38. }
  39. .esri-widget__header {
  40. align-items: center;
  41. background-color: $background-color;
  42. display: flex;
  43. flex: 1 0 100%;
  44. padding: $cap-spacing 0 $cap-spacing $side-spacing;
  45. justify-content: space-between;
  46. min-height: $header-height--min;
  47. width: 100%;
  48. .esri-widget__heading {
  49. align-items: center;
  50. color: $interactive-font-color;
  51. display: flex;
  52. margin: 0;
  53. padding: 0;
  54. text-align: initial;
  55. width: calc(100% - #{$header-button-width});
  56. }
  57. &-button {
  58. -webkit-appearance: none;
  59. align-items: center;
  60. align-self: stretch;
  61. background-color: transparent;
  62. border: none;
  63. color: $interactive-font-color;
  64. cursor: pointer;
  65. display: flex;
  66. flex: 0 0 $header-button-width;
  67. justify-content: center;
  68. padding: 0;
  69. width: $header-button-width;
  70. }
  71. }
  72. .esri-widget__heading {
  73. color: $heading-color;
  74. font-weight: $font-weight__heading;
  75. margin: 0 0 0.5rem 0;
  76. }
  77. h1.esri-widget__heading {
  78. font-size: $font-size__h1;
  79. }
  80. h2.esri-widget__heading {
  81. font-size: $font-size__h2;
  82. }
  83. h3.esri-widget__heading,
  84. h4.esri-widget__heading,
  85. h5.esri-widget__heading,
  86. h6.esri-widget__heading {
  87. font-size: $font-size__lt-h2;
  88. }
  89. .esri-widget__footer {
  90. align-items: center;
  91. background-color: $background-color;
  92. display: flex;
  93. justify-content: center;
  94. min-height: $footer-height--min;
  95. width: 100%;
  96. }
  97. .esri-widget__footer-pagination {
  98. align-items: center;
  99. color: $interactive-font-color;
  100. display: flex;
  101. justify-content: space-between;
  102. &-previous-button,
  103. &-next-button {
  104. background-color: transparent;
  105. border: 0;
  106. margin: 0 $side-spacing--half;
  107. padding: $cap-spacing $side-spacing;
  108. cursor: pointer;
  109. transition: background-color 125ms ease-in-out;
  110. &:hover,
  111. &:focus {
  112. background-color: $background-color--hover;
  113. color: $interactive-font-color--hover;
  114. }
  115. }
  116. }
  117. .esri-menu {
  118. position: absolute;
  119. top: 100%;
  120. left: 0;
  121. z-index: 1;
  122. background-color: $background-color;
  123. @include defaultBoxShadow();
  124. padding: 0;
  125. margin: $cap-spacing--eighth 0 0 0;
  126. font-size: 14px;
  127. line-height: 16px;
  128. -moz-background-clip: padding;
  129. background-clip: padding-box;
  130. overflow: hidden;
  131. width: 100%;
  132. visibility: hidden;
  133. max-height: 0;
  134. .esri-menu__header {
  135. padding: 6px 12px;
  136. background-color: $background-color--inverse;
  137. color: $interactive-font-color--inverse;
  138. }
  139. &__list {
  140. margin: 0;
  141. padding: 0;
  142. list-style: none;
  143. }
  144. &__list-item {
  145. padding: 0.8em 1em;
  146. cursor: pointer;
  147. border-top: solid 1px $border-color;
  148. border-left: $border-size--active solid transparent;
  149. }
  150. &__list-item:first-child {
  151. border-top: none;
  152. }
  153. &__list-item--focus,
  154. &__list-item:hover,
  155. &__list-item:focus {
  156. background-color: $background-color--hover;
  157. }
  158. &__list-item:active {
  159. background-color: $background-color--active;
  160. }
  161. &__list-item--active,
  162. &__list-item--active:hover,
  163. &__list-item--active:focus {
  164. background-color: $background-color--active;
  165. border-left-color: $border-color--active;
  166. }
  167. &__list-item [class^="esri-icon"] {
  168. padding-right: $font-size * 0.2;
  169. }
  170. }
  171. .esri-widget__table {
  172. color: $font-color;
  173. border: none;
  174. border-collapse: collapse;
  175. width: 100%;
  176. tr:nth-child(odd) {
  177. background-color: rgba($background-color--inverse, 0.1);
  178. }
  179. tr:nth-child(even) {
  180. background-color: rgba($background-color--inverse, 0.02);
  181. }
  182. tr {
  183. a {
  184. color: $interactive-font-color;
  185. &:hover,
  186. &:focus {
  187. color: $interactive-font-color--hover;
  188. }
  189. }
  190. td,
  191. th {
  192. padding: 0.5em 0.7em;
  193. word-break: break-word;
  194. vertical-align: top;
  195. font-size: $font-size__body;
  196. font-weight: $font-weight;
  197. }
  198. th {
  199. width: 50%;
  200. text-align: left;
  201. border-right: 3px solid rgba(0, 0, 0, 0.05);
  202. }
  203. td {
  204. width: 50%;
  205. }
  206. }
  207. }
  208. .esri-input {
  209. background-color: $background-color;
  210. border: 1px solid $border-color;
  211. color: $font-color;
  212. font-family: $font-family;
  213. font-size: $font-size;
  214. &[type="text"],
  215. &[type="password"],
  216. &[type="number"] {
  217. height: $button-height;
  218. padding: 0 0.5em;
  219. }
  220. &::-ms-clear {
  221. display: none;
  222. }
  223. &::-moz-placeholder {
  224. color: $font-color--placeholder;
  225. opacity: 1;
  226. }
  227. &:-ms-input-placeholder {
  228. color: $font-color--placeholder;
  229. }
  230. &::-webkit-input-placeholder {
  231. color: $font-color--placeholder;
  232. }
  233. }
  234. .esri-button {
  235. align-items: center;
  236. background-color: $button-color;
  237. border: 1px solid $button-color;
  238. color: $button-color--inverse;
  239. cursor: pointer;
  240. display: flex;
  241. font-family: inherit;
  242. font-size: $font-size;
  243. min-height: $button-height;
  244. justify-content: center;
  245. word-break: normal;
  246. white-space: normal;
  247. overflow: hidden;
  248. padding: $cap-spacing--half $side-spacing--half;
  249. width: 100%;
  250. transition: background-color 125ms ease-in-out, border 125ms ease-in-out;
  251. &:hover {
  252. background-color: $button-color--hover;
  253. border: 1px solid $button-color--hover;
  254. color: $button-color--inverse;
  255. }
  256. &.esri-button--small {
  257. font-size: $font-size--small;
  258. min-height: $button-height--half;
  259. }
  260. &.esri-button--half {
  261. display: inline-block;
  262. width: 50%;
  263. }
  264. &.esri-button--third {
  265. display: inline-block;
  266. width: 33%;
  267. }
  268. }
  269. .esri-button--secondary {
  270. background-color: transparent;
  271. color: $button-color;
  272. }
  273. .esri-button--tertiary {
  274. background-color: transparent;
  275. border-color: transparent;
  276. color: $button-color;
  277. &:hover {
  278. background-color: $background-color--hover;
  279. border-color: transparent;
  280. color: $button-color--hover;
  281. }
  282. }
  283. .esri-button--disabled {
  284. opacity: $opacity--disabled;
  285. pointer-events: none;
  286. }
  287. .esri-button--drill-in {
  288. display: flex;
  289. align-items: center;
  290. justify-content: space-between;
  291. background-color: $background-color;
  292. cursor: pointer;
  293. border: none;
  294. border-radius: $border-radius;
  295. text-align: unset;
  296. text-decoration: none;
  297. padding: $cap-spacing $side-spacing--half;
  298. margin: $cap-spacing $side-spacing--half;
  299. outline-offset: -4px;
  300. transition: background-color 125ms ease-in-out;
  301. @include borderBoxShadow();
  302. &:hover,
  303. &:focus {
  304. background-color: $background-color--hover;
  305. }
  306. &__title {
  307. font-size: $font-size;
  308. font-family: $font-family;
  309. }
  310. [class*="esri-icon"] {
  311. padding: 0 $side-spacing--half;
  312. }
  313. }
  314. [class*="esri-icon"] {
  315. font-size: $icon-size;
  316. display: inline-block;
  317. }
  318. .esri-widget__content--empty {
  319. align-items: center;
  320. color: $interactive-font-color;
  321. display: flex;
  322. flex-flow: column wrap;
  323. padding: $cap-spacing--plus-half $side-spacing--plus-half;
  324. text-align: center;
  325. h1.esri-widget__heading,
  326. h2.esri-widget__heading,
  327. h3.esri-widget__heading,
  328. h4.esri-widget__heading,
  329. h5.esri-widget__heading {
  330. font-weight: $font-weight;
  331. }
  332. }
  333. .esri-widget__content-illustration--empty {
  334. padding: 1rem 0;
  335. width: 128px;
  336. }
  337. .esri-widget__content-icon--empty {
  338. padding: 0.5rem 0;
  339. width: 32px;
  340. }
  341. // Select
  342. $select_caret: "data:image/svg+xml,%3Csvg width%3D%2732%27%20height%3D%2732%27%20viewBox%3D%270%200%2032%2032%27%20xmlns%3D%27http://www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M11%2013l5%205.833L21%2013z%27%20fill%3D%27%23" +
  343. str-slice(#{$interactive-font-color}, 2) + "%27%20fill-rule%3D%27nonzero%27/%3E%3C/svg%3E";
  344. .esri-select {
  345. cursor: pointer;
  346. display: block;
  347. font-family: inherit;
  348. font-size: 0.85em;
  349. width: 100%;
  350. height: $button-height;
  351. color: $font-color;
  352. border: 1px solid $border-color;
  353. margin: 0;
  354. -webkit-appearance: none;
  355. -moz-appearance: none;
  356. border-radius: 0;
  357. padding: 0 0.5em;
  358. background: url($select_caret) no-repeat right center $background-color;
  359. }
  360. .esri-select::-ms-expand {
  361. display: none;
  362. }
  363. // Disabled
  364. .esri-disabled a,
  365. .esri-disabled [class*="esri-icon"],
  366. .esri-disabled [role="menu"],
  367. .esri-disabled [role="checkbox"] {
  368. color: $interactive-font-color--disabled;
  369. }
  370. .keynav-mode {
  371. .esri-widget {
  372. // Saving this for when we can toggle a key-nav class
  373. &:focus {
  374. @include outlineStyle();
  375. }
  376. * {
  377. &:focus {
  378. @include outlineStyle();
  379. }
  380. }
  381. }
  382. }
  383. /* ==========================================================================
  384. Loader
  385. ========================================================================== */
  386. .esri-widget__loader-animation {
  387. animation: esri-rotate 1250ms infinite linear;
  388. transform: translateZ(0);
  389. border: 0.15em solid transparent;
  390. border-color: rgba($font-color, 0.8) $border-color $border-color $border-color;
  391. border-radius: 100%;
  392. display: block;
  393. font-size: $spinning-loader-size;
  394. height: 1em;
  395. width: 1em;
  396. }
  397. /* ==========================================================================
  398. Widget Button
  399. ========================================================================== */
  400. .esri-widget--button {
  401. font-size: $font-size;
  402. background-color: $background-color;
  403. color: $interactive-font-color;
  404. width: $button-width;
  405. height: $button-height;
  406. padding: 0;
  407. margin: 0;
  408. overflow: hidden;
  409. cursor: pointer;
  410. text-align: center;
  411. display: flex;
  412. flex-flow: row nowrap;
  413. justify-content: center;
  414. align-items: center;
  415. transition: background-color 125ms ease-in-out;
  416. &:hover {
  417. background-color: $background-color--hover;
  418. color: $interactive-font-color--hover;
  419. }
  420. &:active {
  421. background-color: $background-color--active;
  422. }
  423. }
  424. /* ==========================================================================
  425. Components (top Widget node in esri-ui-corner)
  426. ========================================================================== */
  427. .esri-ui-corner {
  428. .esri-component {
  429. @include defaultBoxShadow();
  430. }
  431. .esri-expand .esri-widget--panel,
  432. .esri-expand .esri-widget--panel-height-only,
  433. .esri-component.esri-widget--panel,
  434. .esri-component.esri-widget--panel-height-only {
  435. min-height: $panel-min-height--xsmall;
  436. transition: max-height 250ms ease-in-out;
  437. overflow-y: auto;
  438. }
  439. .esri-expand .esri-widget--panel,
  440. .esri-expand .esri-widget--panel-height-only,
  441. .esri-component > .esri-widget--panel,
  442. .esri-component.esri-widget--panel {
  443. width: $panel-width;
  444. .esri-widget--panel {
  445. // widget--panel inside another widget--panel
  446. width: auto;
  447. }
  448. }
  449. }
  450. // Max heights
  451. .esri-view-height-greater-than-medium {
  452. .esri-expand .esri-widget--panel,
  453. .esri-expand .esri-widget--panel-height-only,
  454. .esri-ui-corner .esri-component.esri-widget--panel,
  455. .esri-ui-corner .esri-component.esri-widget--panel-height-only {
  456. max-height: $view-height--gt-medium__component-max-height;
  457. }
  458. }
  459. .esri-view-height-medium {
  460. .esri-expand .esri-widget--panel,
  461. .esri-expand .esri-widget--panel-height-only,
  462. .esri-ui-corner .esri-component.esri-widget--panel,
  463. .esri-ui-corner .esri-component.esri-widget--panel-height-only {
  464. max-height: $view-height--medium__component-max-height;
  465. }
  466. }
  467. .esri-view-height-small {
  468. .esri-expand .esri-widget--panel,
  469. .esri-expand .esri-widget--panel-height-only,
  470. .esri-ui-corner .esri-component.esri-widget--panel,
  471. .esri-ui-corner .esri-component.esri-widget--panel-height-only {
  472. max-height: $view-height--small__component-max-height;
  473. }
  474. }
  475. .esri-view-height-xsmall {
  476. .esri-expand .esri-widget--panel,
  477. .esri-expand .esri-widget--panel-height-only,
  478. .esri-ui-corner .esri-component.esri-widget--panel,
  479. .esri-ui-corner .esri-component.esri-widget--panel-height-only {
  480. max-height: $view-height--xsmall__component-max-height;
  481. }
  482. }
  483. .esri-ui-bottom-right,
  484. .esri-ui-bottom-left {
  485. .esri-menu {
  486. top: auto;
  487. bottom: 100%;
  488. margin-top: 0;
  489. margin-bottom: $cap-spacing--eighth;
  490. }
  491. }
  492. /* ==========================================================================
  493. RTL
  494. ========================================================================== */
  495. html[dir="rtl"] {
  496. .esri-widget__table {
  497. th {
  498. text-align: right;
  499. border-right: none;
  500. border-left: 3px solid rgba(0, 0, 0, 0.05);
  501. }
  502. }
  503. .esri-select {
  504. background-position: left 50%;
  505. }
  506. .esri-menu__list-item [class^="esri-icon"] {
  507. padding-right: 0;
  508. padding-left: floor($font-size * 0.2);
  509. }
  510. .esri-menu__list-item {
  511. border-left: none;
  512. border-right: $border-size--active solid transparent;
  513. }
  514. .esri-menu__list-item--active {
  515. border-right-color: $border-color--active;
  516. }
  517. }
  518. /* ==========================================================================
  519. accessibility
  520. ========================================================================== */
  521. .esri-icon-font-fallback-text {
  522. clip: rect(0 0 0 0);
  523. overflow: hidden;
  524. position: absolute;
  525. height: 1px;
  526. width: 1px;
  527. }
  528. [class^="esri-icon"] {
  529. // fixes IE11 bug where animation will continue after animation class is removed
  530. // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/4784
  531. animation: none;
  532. }
  533. @keyframes esri-fade-in {
  534. 0% {
  535. opacity: 0;
  536. }
  537. 25% {
  538. opacity: 0;
  539. }
  540. 100% {
  541. opacity: 1;
  542. }
  543. }
  544. .esri-rotating {
  545. animation: esri-rotate 1250ms infinite linear;
  546. transform: translateZ(0);
  547. }
  548. /* ==========================================================================
  549. clearfixing
  550. ========================================================================== */
  551. /**
  552. * taken from http://nicolasgallagher.com/micro-clearfix-hack/
  553. *
  554. * For modern browsers
  555. * 1. The space content is one way to avoid an Opera bug when the
  556. * contenteditable attribute is included anywhere else in the document.
  557. * Otherwise it causes space to appear at the top and bottom of elements
  558. * that are clearfixed.
  559. * 2. The use of `table` rather than `block` is only necessary if using
  560. * `:before` to contain the top-margins of child elements.
  561. */
  562. .esri-clearfix {
  563. &:before,
  564. &:after {
  565. content: " ";
  566. /* 1 */
  567. display: table;
  568. /* 2 */
  569. }
  570. &:after {
  571. clear: both;
  572. }
  573. }
  574. /* ==========================================================================
  575. interaction
  576. ========================================================================== */
  577. .esri-interactive {
  578. cursor: pointer;
  579. }
  580. /* ==========================================================================
  581. visibility
  582. ========================================================================== */
  583. .esri-hidden {
  584. display: none !important;
  585. }
  586. .esri-invisible {
  587. visibility: hidden !important;
  588. }
  589. .esri-offscreen {
  590. position: absolute;
  591. top: -999em;
  592. left: -999em;
  593. }
  594. }
  595. @if $include_Widget == true {
  596. @include widget();
  597. }