_Widget.scss 17 KB

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