_Widget.scss 17 KB

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