Files
nextcloud-server-mirror/dist/AppIcon-DuvPAuWD.chunk.mjs.map
2026-10-07 08:58:40 +00:00

1 line
4.2 KiB
Plaintext

{"version":3,"file":"AppIcon-DuvPAuWD.chunk.mjs","sources":["../build/frontend/core/src/components/AppIcon.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<span\n\t\tclass=\"app-icon\"\n\t\t:class=\"{ 'app-icon--outlined': outlined }\">\n\t\t<span\n\t\t\tv-if=\"icon\"\n\t\t\tclass=\"app-icon__img\"\n\t\t\t:style=\"iconStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<!-- @slot Overlay positioned over the circle, e.g. an unread badge. -->\n\t\t<slot />\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n\t/** URL of the app icon, used as a CSS mask. */\n\ticon: string\n\n\t/** Render the circle as an outline only (no fill or gradient). */\n\toutlined?: boolean\n}>()\n\n// Escaped so a crafted path cannot break out of the url() token.\nconst iconStyle = computed(() => ({\n\t'--app-icon-url': `url(\"${props.icon.replace(/[\"\\\\]/g, '\\\\$&')}\")`,\n}))\n</script>\n\n<style scoped lang=\"scss\">\n$bevel:\n\tinset 0 -1px 0 0 color-mix(in srgb, var(--color-primary-element-light), 10% var(--color-primary-element)),\n\tinset 0 -4px 6px -4px color-mix(in srgb, var(--color-primary-element-light), 16% var(--color-primary-element));\n\n.app-icon {\n\t--app-icon-circle-size: calc(var(--default-grid-baseline) * 12);\n\t// 28px on a 48px circle, so it follows when consumers resize the circle.\n\t--app-icon-icon-size: calc(var(--app-icon-circle-size) * 7 / 12);\n\t--app-icon-bevel: #{$bevel};\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: var(--app-icon-circle-size);\n\theight: var(--app-icon-circle-size);\n\tmin-height: var(--app-icon-circle-size);\n\tborder-radius: 50%;\n\ttransform: scale(var(--app-icon-scale, 1));\n\ttransition: transform var(--animation-quick) ease-out;\n\tbackground-color: var(--color-primary-element-light);\n\tbackground-image: linear-gradient(\n\t\tto bottom,\n\t\tcolor-mix(in srgb, var(--color-primary-element-light), 15% var(--color-main-background)) 0%,\n\t\tvar(--color-primary-element-light) 100%\n\t);\n\tbox-shadow: var(--app-icon-bevel);\n\n\t@media (prefers-color-scheme: dark) {\n\t\t--app-icon-bevel: none;\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\ttransition: none;\n\t}\n\n\t&__img {\n\t\twidth: var(--app-icon-icon-size);\n\t\theight: var(--app-icon-icon-size);\n\t\t// Masked rather than shown: app icons ship a hardcoded fill, so\n\t\t// currentColor never applies and a filter could only flip black and white.\n\t\tbackground-color: var(--color-primary-element);\n\t\tbackground-image: linear-gradient(\n\t\t\tto bottom,\n\t\t\tcolor-mix(in srgb, var(--color-primary-element), 28% var(--color-primary-element-light)) 0%,\n\t\t\tvar(--color-primary-element) 100%\n\t\t);\n\t\tmask: var(--app-icon-url) center / contain no-repeat;\n\t}\n\n\t// Masked backgrounds are not force-adjusted the way <img> is.\n\t@media (forced-colors: active) {\n\t\t&__img {\n\t\t\tbackground-color: CanvasText;\n\t\t\tbackground-image: none;\n\t\t}\n\t}\n\n\t// Utility entries (\"More apps\", \"App store\") stay subdued: a plain circle\n\t// with the icon in the same muted color as the label.\n\t&--outlined {\n\t\tbackground: transparent;\n\t\tbackground-image: none;\n\t\tbox-shadow: inset 0 0 0 2px var(--color-border);\n\t}\n\n\t&--outlined &__img {\n\t\tbackground-color: var(--color-text-maxcontrast);\n\t\tbackground-image: none;\n\t}\n}\n\n// An explicit theme choice must beat the media query above, which only sees the OS.\n:global([data-themes*=dark] .app-icon) {\n\t--app-icon-bevel: none;\n}\n\n:global([data-themes*=light] .app-icon) {\n\t--app-icon-bevel: #{$bevel};\n}\n</style>\n"],"names":["props","__props","iconStyle","computed","_createElementBlock","_normalizeClass","_renderSlot","_ctx"],"mappings":"iOAsBA,MAAMA,EAAQC,EASRC,EAAYC,EAAS,KAAO,CACjC,iBAAkB,QAAQH,EAAM,KAAK,QAAQ,SAAU,MAAM,CAAC,IAAA,EAC7D,oBA3BDI,EAUO,OAAA,CATN,MAAKC,EAAA,CAAC,WAAU,CAAA,qBACgBJ,EAAA,SAAQ,CAAA,CAAA,GAEjCA,EAAA,UADPG,EAIsB,OAAA,OAFrB,MAAM,gBACL,QAAOF,EAAA,KAAS,EACjB,cAAY,MAAA,oBAEbI,EAAQC,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA"}