_Legend.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. @use "sass:math";
  2. $relationship_column_size: 85px;
  3. @mixin legend() {
  4. .esri-legend {
  5. overflow: hidden;
  6. overflow-y: auto;
  7. }
  8. .esri-legend__message {
  9. padding: 0.5em 1em;
  10. }
  11. .esri-legend__service {
  12. padding: $cap-spacing $side-spacing;
  13. word-wrap: break-word;
  14. border-bottom: 1px solid $border-color;
  15. }
  16. .esri-legend__service:last-child {
  17. border-bottom: none;
  18. }
  19. .esri-legend__layer {
  20. margin-left: $side-spacing--half;
  21. overflow: auto;
  22. }
  23. .esri-legend__group-layer-child {
  24. margin-left: $side-spacing--half;
  25. padding-left: 0;
  26. padding-right: 0;
  27. }
  28. .esri-legend__layer-table {
  29. display: flex;
  30. flex-flow: column;
  31. width: 100%;
  32. margin-bottom: $cap-spacing;
  33. }
  34. .esri-legend__layer-child-table {
  35. display: table;
  36. border-collapse: collapse;
  37. width: 100%;
  38. margin-bottom: $cap-spacing;
  39. }
  40. .esri-legend__layer-body {
  41. margin-left: $side-spacing--half;
  42. }
  43. .esri-legend__layer-row {
  44. display: flex;
  45. }
  46. .esri-legend__layer-cell {
  47. min-width: 100px;
  48. word-break: break-word;
  49. padding: $cap-spacing--third 0;
  50. vertical-align: middle;
  51. }
  52. .esri-legend__layer-cell--symbols {
  53. min-width: 10px;
  54. text-align: center;
  55. }
  56. // Size ramps
  57. .esri-legend__layer-table--size-ramp {
  58. display: table;
  59. }
  60. .esri-legend__layer-table--size-ramp .esri-legend__layer-row {
  61. display: table-row;
  62. }
  63. .esri-legend__layer-table--size-ramp .esri-legend__layer-cell {
  64. display: table-cell;
  65. }
  66. .esri-legend__size-ramp ~ .esri-legend__layer-cell--info {
  67. max-width: 80%;
  68. width: 80%;
  69. }
  70. .esri-legend__layer-cell--info {
  71. font-size: $font-size--small;
  72. padding-left: $side-spacing--half;
  73. padding-right: $side-spacing--half;
  74. word-wrap: normal;
  75. word-break: normal;
  76. max-width: 250px;
  77. }
  78. .esri-legend__imagery-layer-image--stretched {
  79. margin-bottom: -2px; //imageData contains extra right and bottom 2px margin
  80. display: block;
  81. }
  82. .esri-legend__imagery-layer-cell--stretched {
  83. vertical-align: top;
  84. line-height: 1;
  85. padding: 0;
  86. }
  87. .esri-legend__imagery-layer-info--stretched {
  88. vertical-align: top;
  89. padding: 0 2px;
  90. }
  91. .esri-legend__symbol {
  92. display: flex;
  93. justify-content: center;
  94. }
  95. .esri-legend__layer-caption {
  96. display: table-caption;
  97. padding: $cap-spacing--half 0;
  98. word-break: break-word;
  99. }
  100. .esri-legend__ramp-labels {
  101. display: flex;
  102. flex-flow: column nowrap;
  103. justify-content: space-between;
  104. }
  105. .esri-legend__ramps {
  106. margin-left: $side-spacing--quarter;
  107. }
  108. .esri-legend__color-ramp {
  109. width: 24px;
  110. }
  111. .esri-legend__opacity-ramp {
  112. background-image: url("../base/images/transparent-bg.png");
  113. }
  114. .esri-legend__ramp-tick {
  115. position: absolute;
  116. width: 4px;
  117. border-top: 1px solid $border-color;
  118. line-height: 0;
  119. right: 1px;
  120. left: auto;
  121. }
  122. .esri-legend__ramp-label {
  123. position: relative;
  124. padding: 0 $side-spacing--half;
  125. white-space: nowrap;
  126. line-height: 1em;
  127. font-size: $font-size--small;
  128. &:before {
  129. position: absolute;
  130. top: 0.25em;
  131. right: 100%;
  132. display: block;
  133. content: "";
  134. width: 0;
  135. height: 0;
  136. border-style: solid;
  137. border-width: 3px 4px 3px 0;
  138. border-color: transparent rgba($font-color, 0.8) transparent transparent;
  139. }
  140. &:first-child {
  141. margin-top: floor(math.div($font-size, 3)) * -1;
  142. }
  143. &:last-child {
  144. bottom: floor($font-size * 0.25) * -1;
  145. }
  146. }
  147. .esri-legend-layer-caption {
  148. display: table-caption;
  149. padding: $cap-spacing--half 0;
  150. }
  151. [dir="rtl"] {
  152. .esri-legend__ramp-label:before {
  153. border-width: 3px 0 3px 4px;
  154. border-color: transparent transparent transparent rgba($font-color, 0.8);
  155. left: 100%;
  156. right: auto;
  157. }
  158. .esri-legend__layer,
  159. .esri-legend__group-layer-child,
  160. .esri-legend__layer-body {
  161. margin-left: 0;
  162. margin-right: $side-spacing--half;
  163. overflow: auto;
  164. }
  165. .esri-legend__ramps {
  166. margin-left: auto;
  167. margin-right: $side-spacing--quarter;
  168. }
  169. }
  170. }
  171. @mixin cardLegend() {
  172. $legend_min_width: $panel-width;
  173. $carousel_min_width: $legend_min_width;
  174. $carousel_min_height: 250px;
  175. $carousel_slide_side_length: $legend_min_width - 50;
  176. $indicator_size: 10px;
  177. .esri-legend--card {
  178. display: flex;
  179. overflow-x: auto;
  180. transition: max-width 250ms ease-in-out;
  181. background: $background-color;
  182. position: relative;
  183. }
  184. .esri-legend--card__section {
  185. font-size: $font-size__body;
  186. min-width: $legend_min_width;
  187. padding: $cap-spacing $side-spacing;
  188. border-left: 1px solid $border-color;
  189. overflow: auto;
  190. &:first-child {
  191. border-left: none;
  192. }
  193. }
  194. .esri-legend--card__message {
  195. padding: 0.5em 1em;
  196. }
  197. .esri-legend--card__service-caption-container {
  198. font-weight: $font-weight__heading;
  199. height: 45px;
  200. padding: $cap-spacing $side-spacing;
  201. border-bottom: 1px solid $border-color;
  202. }
  203. .esri-legend--card__service-caption-text {
  204. margin: 0;
  205. overflow: auto;
  206. padding-bottom: 20px;
  207. }
  208. .esri-legend--card__layer-caption {
  209. font-weight: $font-weight;
  210. margin-bottom: $cap-spacing;
  211. padding: $cap-spacing--half 0;
  212. }
  213. .esri-legend--card__service-content {
  214. display: flex;
  215. height: calc(100% - 45px);
  216. }
  217. .esri-legend--card__label-container {
  218. display: flex;
  219. flex-wrap: wrap;
  220. }
  221. .esri-legend--card__relationship-label-container {
  222. display: flex;
  223. flex-direction: column;
  224. .esri-legend--card__layer-row {
  225. padding-bottom: 0.5em;
  226. }
  227. .esri-legend--card__layer-row:last-child {
  228. padding-bottom: 0em;
  229. }
  230. }
  231. .esri-legend--card__relationship-section {
  232. border: none;
  233. }
  234. .esri-legend--card__label-element {
  235. margin: 0.1em;
  236. padding: 0.5em 1em;
  237. min-width: 4em;
  238. min-height: 2.7em;
  239. text-align: center;
  240. }
  241. .esri-legend--card__image-label {
  242. padding-left: $side-spacing--half;
  243. padding-right: $side-spacing--half;
  244. }
  245. .esri-legend--card__layer-row,
  246. .esri-legend--card__size-ramp-container {
  247. display: flex;
  248. align-items: center;
  249. }
  250. .esri-legend--card__size-ramp-preview {
  251. display: flex;
  252. }
  253. .esri-legend--card__ramp-label {
  254. white-space: nowrap;
  255. margin: 0 0.5em;
  256. }
  257. .esri-legend--card__interval-separator {
  258. text-align: center;
  259. font-size: 0.5em;
  260. }
  261. .esri-legend--card__imagery-layer-image--stretched {
  262. margin-bottom: -2px; //imageData contains extra right and bottom 2px margin
  263. display: block;
  264. }
  265. .esri-legend--card__symbol-container {
  266. position: relative;
  267. }
  268. .esri-legend--card__interval-separators-container {
  269. position: absolute;
  270. left: 50%;
  271. top: 50px;
  272. transform: translate(-50%, -50%);
  273. }
  274. .esri-legend--card__carousel-title {
  275. margin: 0;
  276. }
  277. .esri-legend--card__service {
  278. min-width: fit-content;
  279. border-left: 1px solid $border-color;
  280. }
  281. .esri-legend--card__symbol {
  282. display: block;
  283. margin: auto;
  284. }
  285. .esri-legend--stacked {
  286. min-width: $carousel_min_width;
  287. display: flex;
  288. flex-direction: column;
  289. .esri-legend--card__section {
  290. border: none;
  291. overflow: auto;
  292. height: auto;
  293. width: $carousel_slide_side_length;
  294. }
  295. .esri-legend--card__size-ramp-row {
  296. flex-direction: column;
  297. }
  298. .esri-legend--card__symbol-row {
  299. display: table-row;
  300. margin: 5px 0;
  301. width: 100%;
  302. }
  303. .esri-legend--card__label-cell {
  304. display: table-cell;
  305. vertical-align: middle;
  306. }
  307. .esri-legend--card__symbol-cell {
  308. display: table-cell;
  309. vertical-align: middle;
  310. text-align: center;
  311. }
  312. .esri-legend--card__carousel-indicator-container {
  313. box-shadow: 0 -1px 0 $border-color;
  314. display: flex;
  315. height: $button-height;
  316. width: $legend_min_width;
  317. justify-content: center;
  318. overflow: auto;
  319. }
  320. .esri-legend--card__carousel-indicator {
  321. cursor: pointer;
  322. display: flex;
  323. justify-content: center;
  324. align-items: center;
  325. height: 100%;
  326. width: $button-width--half;
  327. }
  328. .esri-legend--card__carousel-indicator:before {
  329. background-color: transparent;
  330. border-radius: 50%;
  331. box-shadow: 0 0 0 1px $interactive-font-color;
  332. content: "";
  333. display: block;
  334. height: $indicator_size;
  335. transition: background-color 125ms ease-in-out;
  336. width: $indicator_size;
  337. }
  338. .esri-legend--card__carousel-indicator:hover::before,
  339. .esri-legend--card__carousel-indicator--activated:before,
  340. .esri-legend--card__carousel-indicator--activated:hover::before {
  341. background-color: $interactive-font-color;
  342. }
  343. }
  344. //////////////////////////////
  345. // UI CORNER
  346. .esri-ui-corner {
  347. max-width: 100%;
  348. .esri-legend--card {
  349. max-height: $panel-max-height--small;
  350. }
  351. }
  352. // UI CORNER
  353. //////////////////////////////
  354. //////////////////////////////
  355. // RTL
  356. [dir="rtl"] .esri-view-width-greater-than-small {
  357. // scoped to view size to not interfere with carousel
  358. .esri-legend--card__section {
  359. border-left: 0;
  360. border-right: 1px solid $border-color;
  361. }
  362. .esri-legend--card__section:first-child {
  363. border-right: none;
  364. }
  365. }
  366. // RTL
  367. //////////////////////////////
  368. }
  369. @mixin relationshipRamp() {
  370. .esri-relationship-ramp--diamond__container {
  371. display: flex;
  372. font-size: $font-size--small;
  373. }
  374. .esri-relationship-ramp--diamond__left-column {
  375. align-self: center;
  376. padding-right: 5px;
  377. text-align: right;
  378. max-width: $relationship_column_size;
  379. }
  380. .esri-relationship-ramp--diamond__right-column {
  381. align-self: center;
  382. padding-left: 5px;
  383. text-align: left;
  384. max-width: $relationship_column_size;
  385. }
  386. .esri-relationship-ramp--diamond__middle-column {
  387. display: flex;
  388. flex-direction: column;
  389. text-align: center;
  390. }
  391. .esri-relationship-ramp--diamond__middle-column--label {
  392. align-self: center;
  393. max-width: $relationship_column_size;
  394. }
  395. .esri-relationship-ramp--diamond__middle-column--ramp {
  396. width: $relationship_column_size;
  397. height: $relationship_column_size;
  398. }
  399. .esri-relationship-ramp--square__table {
  400. display: table;
  401. font-size: $font-size--small;
  402. }
  403. .esri-relationship-ramp--square__table-row {
  404. display: table-row;
  405. }
  406. .esri-relationship-ramp--square__table-cell {
  407. display: table-cell;
  408. }
  409. .esri-relationship-ramp--square__table-label {
  410. max-width: 95px;
  411. }
  412. .esri-relationship-ramp--square__table-label--left-bottom {
  413. text-align: left;
  414. vertical-align: bottom;
  415. }
  416. .esri-relationship-ramp--square__table-label--right-bottom {
  417. text-align: right;
  418. vertical-align: bottom;
  419. }
  420. .esri-relationship-ramp--square__table-label--left-top {
  421. text-align: left;
  422. vertical-align: top;
  423. }
  424. .esri-relationship-ramp--square__table-label--right-top {
  425. text-align: right;
  426. vertical-align: top;
  427. }
  428. }
  429. @mixin univariateAboveAndBelowRamp() {
  430. .esri-univariate-above-and-below-ramp__symbol {
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. }
  435. .esri-univariate-above-and-below-ramp__label {
  436. position: relative;
  437. white-space: nowrap;
  438. line-height: 1em;
  439. font-size: $font-size--small;
  440. margin-left: 7px;
  441. &:before {
  442. position: absolute;
  443. top: 0.45em;
  444. left: -19px;
  445. display: block;
  446. content: "";
  447. width: 14px;
  448. height: 0;
  449. border-style: solid;
  450. border-width: 1px 0 0 0;
  451. }
  452. &:first-child {
  453. top: floor(math.div($font-size, 2.2)) * -1;
  454. }
  455. &:last-child {
  456. bottom: floor(math.div($font-size, 2.2)) * -1;
  457. }
  458. }
  459. .esri-univariate-above-and-below-ramp__color--card {
  460. position: relative;
  461. &:before {
  462. position: absolute;
  463. top: 1px;
  464. display: block;
  465. content: "";
  466. width: 100%;
  467. height: 15px;
  468. border-left: 1px solid #000;
  469. border-right: 1px solid #000;
  470. }
  471. }
  472. [dir="rtl"] {
  473. .esri-univariate-above-and-below-ramp__label {
  474. margin-left: auto;
  475. margin-right: 7px;
  476. &:before {
  477. left: auto;
  478. right: -19px;
  479. }
  480. }
  481. }
  482. }
  483. @if $include_Legend == true {
  484. @include legend();
  485. @include cardLegend();
  486. @include relationshipRamp();
  487. @include univariateAboveAndBelowRamp();
  488. }