/
githubmirror
/
obsidian-maps
Обзор
Документация
Войти
/
githubmirror
/
obsidian-maps
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
0.1.1
styles.css
628 строк
13 KB
Steph Ango
First pass with Bases API
24 сен 2025, 19:43
24 сен 2025, 19:43
3cc8d62
Код
Авторство
О чём код?
body { --bases-map-embed-height: 400px; --bases-map-marker-background: var(--interactive-accent); --bases-map-marker-icon-color: white; --bases-map-blend-mode: normal; } .bases-view[data-view-type="map"] { --bases-embed-border-width: 0px; --bases-view-padding: 0; position: relative; } .workspace-leaf-content[data-type="bases"] { .bases-map { height: 100%; } } .bases-map-container { position: relative; width: 100%; height: 100%; overflow: hidden; } .bases-map { width: 100%; height: var(--bases-map-embed-height); overflow: hidden; position: relative; canvas { mix-blend-mode: var(--bases-map-blend-mode); } .maplibregl-map { background-color: var(--background-primary); width: 100% !important; height: 100% !important; border-radius: var(--radius-s); } .maplibregl-ctrl-group { border-radius: var(--radius-s); background-color: var(--background-primary); border: 1px solid var(--background-modifier-border); box-shadow: var(--input-shadow); display: flex; flex-direction: column; overflow: hidden; button { border-radius: 0; box-shadow: none; height: auto; display: flex; line-height: 1; font-size: inherit; align-items: center; justify-content: center; cursor: var(--cursor); padding: var(--size-4-2); color: var(--text-muted); background-color: var(--interactive-normal); --icon-size: var(--icon-s); --icon-stroke: var(--icon-s-stroke-width); &:hover { background-color: var(--interactive-hover); color: var(--text-normal); } &:not(:last-child) { border-bottom: 1px solid var(--background-modifier-border); } } } .maplibregl-ctrl-attrib { background-color: rgba(var(--mono-rgb-0), 0.8); color: var(--text-muted); font-size: var(--font-ui-smaller); padding: 1px 8px; a { color: var(--text-muted); } } .maplibregl-popup-content { background-color: var(--background-primary); color: var(--text-normal); border-radius: var(--radius-m); box-shadow: var(--shadow-s); border: var(--modal-border-width) solid var(--modal-border-color); } &.is-loading { display: flex; align-items: center; justify-content: center; &::before { color: var(--text-muted); } } } .bases-map-marker { cursor: var(--cursor-link); } .bases-map-custom-marker { display: flex; align-items: center; justify-content: center; margin-top: -12px; width: 24px; aspect-ratio: 0.8; color: var(--text-on-accent); cursor: var(--cursor-link); .bases-map-marker-icon { position: absolute; top: 0; padding: 4px; display: flex; align-items: center; justify-content: center; color: var(--bases-map-marker-icon-color); --icon-size: 100%; --icon-stroke: 2px; } .bases-map-marker-dot { position: absolute; top: 7px; margin: 0 auto; width: 8px; height: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background-color: var(--bases-map-marker-icon-color); } .bases-map-marker-pin-outline { position: absolute; mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='32' fill='none'%3E%3Cpath fill='%23000' d='M23 12a11 11 0 0 0-22 0c0 2.21 1.33 5 3.45 8.19 2.09 3.17 4.76 6.5 7.25 9.89.1.13.18.2.23.23l.07.02.07-.02c.05-.03.14-.1.23-.23 2.48-3.38 5.16-6.75 7.25-9.94 2.12-3.22 3.45-6 3.45-8.14Zm1 .23c-.19 4.94-6.08 11.87-10.89 18.44l-.12.15c-.6.68-1.38.68-1.98 0l-.12-.15C6.08 24.1.19 17.3 0 12.24V12a12 12 0 1 1 24 0v.23Z'/%3E%3C/svg%3E"); mask-size: 98% 100%; mask-repeat: no-repeat; mask-position: center; background-color: rgba(var(--mono-rgb-100), 0.25); height: 100%; width: 100%; } .bases-map-marker-pin { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='32' fill='none'%3E%3Cpath fill='%23000' d='M24.3 12.15c0 5.02-6.07 12.15-11.03 18.9-.65.9-1.58.9-2.24 0C6.08 24.3 0 17.3 0 12.15a12.15 12.15 0 1 1 24.3 0Z'/%3E%3C/svg%3E"); mask-size: 100% 100%; mask-repeat: no-repeat; mask-position: center; background-color: var(--marker-color, var(--bases-map-marker-background)); height: 100%; width: 100%; } .bases-map-marker-shadow { bottom: -2px; position: absolute; width: 80%; margin: 0 auto; border-radius: 50%; background-color: #00000063; height: 8px; filter: blur(2px); } } .bases-map-popup { min-width: 200px; max-width: 300px; .bases-map-popup-title { --link-weight: calc(var(--font-weight) + var(--bold-modifier)); font-size: var(--font-ui-medium); padding: var(--size-4-2); a { color: var(--text-normal); text-decoration: none; &:hover { color: var(--text-accent); } } } .bases-map-popup-properties { display: flex; flex-direction: column; gap: var(--size-4-2); } } .bases-map-popup-property { font-size: var(--font-ui-small); &:last-child { padding-bottom: var(--size-4-2); } } .bases-map-popup-property-label { font-size: var(--font-ui-smaller); color: var(--text-muted); padding: 0 var(--size-4-2); } .bases-map-popup-property-value { color: var(--text-normal); word-break: break-word; padding: 0 var(--size-4-2); } .maplibregl-map { overflow: hidden; position: relative; -webkit-tap-highlight-color: rgb(0, 0, 0, 0); } .maplibregl-canvas { position: absolute; left: 0; top: 0; } .maplibregl-ctrl-group button.maplibregl-ctrl-compass { touch-action: none; } .maplibregl-canvas-container.maplibregl-interactive, .maplibregl-ctrl-group button.maplibregl-ctrl-compass { cursor: grab; user-select: none; } .maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer { cursor: pointer; } .maplibregl-canvas-container.maplibregl-interactive:active, .maplibregl-ctrl-group button.maplibregl-ctrl-compass:active { cursor: grabbing; } .maplibregl-canvas-container.maplibregl-touch-zoom-rotate, .maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas { touch-action: pan-x pan-y; } .maplibregl-canvas-container.maplibregl-touch-drag-pan, .maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: pinch-zoom; } .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan, .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: none; } .maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures, .maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas { touch-action: pan-x pan-y; } .maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; } .maplibregl-ctrl-top-left { top: 0; left: 0; } .maplibregl-ctrl-top-right { top: 0; right: 0; } .maplibregl-ctrl-bottom-left { bottom: 0; left: 0; } .maplibregl-ctrl-bottom-right { right: 0; bottom: 0; } .maplibregl-ctrl { clear: both; pointer-events: auto; /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */ transform: translate(0, 0); } .maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; } .maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; } .maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; } .maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; } .maplibregl-ctrl-group:not(:empty) { box-shadow: 0 0 0 2px rgb(0, 0, 0, 0.1); } @media (forced-colors: active) { .maplibregl-ctrl-group:not(:empty) { box-shadow: 0 0 0 2px ButtonText; } } .maplibregl-ctrl button .maplibregl-ctrl-icon { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-position: center center; } .maplibregl-ctrl button:disabled { cursor: not-allowed; } .maplibregl-ctrl button:disabled .maplibregl-ctrl-icon { opacity: 0.25; } @media (hover: hover) { .maplibregl-ctrl button:not(:disabled):hover { background-color: rgb(0, 0, 0, 0.05); } } .maplibregl-ctrl-group button:focus:not(:focus-visible) { box-shadow: none; } .maplibregl-ctrl-group button:focus:only-child { border-radius: inherit; } .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon { animation: maplibregl-spin 2s infinite linear; } @keyframes maplibregl-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } a.maplibregl-ctrl-logo { width: 88px; height: 23px; margin: 0 0 -4px -4px; display: block; background-repeat: no-repeat; cursor: pointer; overflow: hidden; background-image: svg-load("svg/maplibregl-ctrl-logo.svg"); } a.maplibregl-ctrl-logo.maplibregl-compact { width: 14px; } .maplibregl-ctrl.maplibregl-ctrl-attrib { padding: 0 5px; background-color: rgb(255, 255, 255, 0.5); margin: 0; } @media screen { .maplibregl-ctrl-attrib.maplibregl-compact { min-height: 20px; padding: 2px 24px 2px 0; margin: 10px; position: relative; background-color: var(--background-primary); color: #000; border-radius: 12px; box-sizing: content-box; } .maplibregl-ctrl-attrib.maplibregl-compact-show { padding: 2px 28px 2px 8px; visibility: visible; } .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show, .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show { padding: 2px 8px 2px 28px; border-radius: 12px; } .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner { display: none; } .maplibregl-ctrl-attrib-button { display: none; cursor: pointer; position: absolute; background-image: svg-load("svg/maplibregl-ctrl-attrib.svg"); background-color: rgb(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px; outline: none; top: 0; right: 0; border: 0; } .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button { appearance: none; list-style: none; } .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker { display: none; } .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button, .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button { left: 0; } .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button, .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner { display: block; } .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button { background-color: rgb(0, 0, 0, 0.05); } .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after { bottom: 0; right: 0; } .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after { top: 0; right: 0; } .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after { top: 0; left: 0; } .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after { bottom: 0; left: 0; } } @media screen and (forced-colors: active) { .maplibregl-ctrl-attrib.maplibregl-compact::after { background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff); } } @media screen and (forced-colors: active) and (prefers-color-scheme: light) { .maplibregl-ctrl-attrib.maplibregl-compact::after { background-image: svg-load("svg/maplibregl-ctrl-attrib.svg"); } } .maplibregl-ctrl-attrib a { color: rgb(0, 0, 0, 0.75); text-decoration: none; } .maplibregl-ctrl-attrib a:hover { color: inherit; text-decoration: underline; } .maplibregl-attrib-empty { display: none; } .maplibregl-ctrl-scale { background-color: rgb(255, 255, 255, 0.75); border-width: medium 2px 2px; border-style: none solid solid; border-color: #333; padding: 0 5px; color: #333; box-sizing: border-box; } .maplibregl-popup { position: absolute; top: 0; left: 0; display: flex; will-change: transform; pointer-events: none; } .maplibregl-popup-anchor-top, .maplibregl-popup-anchor-top-left, .maplibregl-popup-anchor-top-right { flex-direction: column; } .maplibregl-popup-anchor-bottom, .maplibregl-popup-anchor-bottom-left, .maplibregl-popup-anchor-bottom-right { flex-direction: column-reverse; } .maplibregl-popup-anchor-left { flex-direction: row; } .maplibregl-popup-anchor-right { flex-direction: row-reverse; } .maplibregl-popup-close-button { position: absolute; right: 0; top: 0; border: 0; border-radius: 0 3px 0 0; cursor: pointer; background-color: transparent; } .maplibregl-popup-close-button:hover { background-color: rgb(0, 0, 0, 0.05); } .maplibregl-popup-content { position: relative; pointer-events: auto; } .maplibregl-popup-anchor-top-left .maplibregl-popup-content { border-top-left-radius: 0; } .maplibregl-popup-anchor-top-right .maplibregl-popup-content { border-top-right-radius: 0; } .maplibregl-popup-anchor-bottom-left .maplibregl-popup-content { border-bottom-left-radius: 0; } .maplibregl-popup-anchor-bottom-right .maplibregl-popup-content { border-bottom-right-radius: 0; } .maplibregl-popup-track-pointer { display: none; } .maplibregl-popup-track-pointer * { pointer-events: none; user-select: none; } .maplibregl-map:hover .maplibregl-popup-track-pointer { display: flex; } .maplibregl-map:active .maplibregl-popup-track-pointer { display: none; } .maplibregl-marker { position: absolute; top: 0; left: 0; will-change: transform; transition: opacity 0.2s; } .maplibregl-crosshair, .maplibregl-crosshair .maplibregl-interactive, .maplibregl-crosshair .maplibregl-interactive:active { cursor: crosshair; } .maplibregl-boxzoom { position: absolute; top: 0; left: 0; width: 0; height: 0; background: var(--background-primary); border: 2px dotted #202020; opacity: 0.5; }