mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-19 19:28:00 +02:00
dep: Adds Font Awesome, and builds an Icon component
This commit is contained in:
parent
f4196c79d4
commit
03e980eafc
@ -18,6 +18,11 @@
|
||||
"@astrojs/react": "^3.3.2",
|
||||
"@emotion/react": "^11.11.4",
|
||||
"@emotion/styled": "^11.11.5",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
||||
"@fortawesome/free-brands-svg-icons": "^6.5.2",
|
||||
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
||||
"@fortawesome/svelte-fontawesome": "^0.2.2",
|
||||
"@types/react": "^18.3.1",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.7.1",
|
||||
|
35
src/components/molecules/Icon.svelte
Normal file
35
src/components/molecules/Icon.svelte
Normal file
@ -0,0 +1,35 @@
|
||||
<script lang="ts">
|
||||
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
|
||||
import * as brands from '@fortawesome/free-brands-svg-icons';
|
||||
import * as solidIcons from '@fortawesome/free-solid-svg-icons';
|
||||
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
||||
|
||||
|
||||
export const iconMap: Record<string, IconDefinition> = {
|
||||
check: solidIcons.faCheck,
|
||||
plus: solidIcons.faPlus,
|
||||
github: brands.faGithubAlt,
|
||||
code: solidIcons.faCode,
|
||||
rocket: solidIcons.faRocket,
|
||||
};
|
||||
|
||||
export let name: string;
|
||||
export let size: number = 1;
|
||||
export let color: string = 'currentColor';
|
||||
export let styles: string = '';
|
||||
|
||||
</script>
|
||||
|
||||
{#if iconMap[name]}
|
||||
<FontAwesomeIcon
|
||||
class="fa-icon"
|
||||
style={`--icon-size: ${size}rem; --icon-color: ${color}; ${styles}`}
|
||||
icon={iconMap[name]} />
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
:global(.fa-icon) {
|
||||
width: var(--icon-size, 1rem);
|
||||
color: var(--icon-color, currentColor);
|
||||
}
|
||||
</style>
|
38
yarn.lock
38
yarn.lock
@ -969,6 +969,44 @@
|
||||
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d"
|
||||
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==
|
||||
|
||||
"@fortawesome/fontawesome-common-types@6.5.2":
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.2.tgz#eaf2f5699f73cef198454ebc0c414e3688898179"
|
||||
integrity sha512-gBxPg3aVO6J0kpfHNILc+NMhXnqHumFxOmjYCFfOiLZfwhnnfhtsdA2hfJlDnj+8PjAs6kKQPenOTKj3Rf7zHw==
|
||||
|
||||
"@fortawesome/fontawesome-svg-core@^6.5.2":
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.2.tgz#4b42de71e196039b0d5ccf88559b8044e3296c21"
|
||||
integrity sha512-5CdaCBGl8Rh9ohNdxeeTMxIj8oc3KNBgIeLMvJosBMdslK/UnEB8rzyDRrbKdL1kDweqBPo4GT9wvnakHWucZw==
|
||||
dependencies:
|
||||
"@fortawesome/fontawesome-common-types" "6.5.2"
|
||||
|
||||
"@fortawesome/free-brands-svg-icons@^6.5.2":
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.2.tgz#bfca0cebd2c4713dc93244e1fa8b384f1f023587"
|
||||
integrity sha512-zi5FNYdmKLnEc0jc0uuHH17kz/hfYTg4Uei0wMGzcoCL/4d3WM3u1VMc0iGGa31HuhV5i7ZK8ZlTCQrHqRHSGQ==
|
||||
dependencies:
|
||||
"@fortawesome/fontawesome-common-types" "6.5.2"
|
||||
|
||||
"@fortawesome/free-regular-svg-icons@^6.5.2":
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.2.tgz#e8e04b4368d49920abdf1bacc63c67c870635222"
|
||||
integrity sha512-iabw/f5f8Uy2nTRtJ13XZTS1O5+t+anvlamJ3zJGLEVE2pKsAWhPv2lq01uQlfgCX7VaveT3EVs515cCN9jRbw==
|
||||
dependencies:
|
||||
"@fortawesome/fontawesome-common-types" "6.5.2"
|
||||
|
||||
"@fortawesome/free-solid-svg-icons@^6.5.2":
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.2.tgz#9b40b077b27400a5e9fcbf2d15b986c7be69e9ca"
|
||||
integrity sha512-QWFZYXFE7O1Gr1dTIp+D6UcFUF0qElOnZptpi7PBUMylJh+vFmIedVe1Ir6RM1t2tEQLLSV1k7bR4o92M+uqlw==
|
||||
dependencies:
|
||||
"@fortawesome/fontawesome-common-types" "6.5.2"
|
||||
|
||||
"@fortawesome/svelte-fontawesome@^0.2.2":
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/svelte-fontawesome/-/svelte-fontawesome-0.2.2.tgz#7b17bbbba712d18dbbcbc6003b6d38fb1ef9b477"
|
||||
integrity sha512-mOtb+KygPEol7wOgUbINVCyLVKTz7C36BKxTJ3D2VAuOpT4pW5FfCdzKYSg8mm5IuHQ5qFg/Ey9cX9ubYNGDYw==
|
||||
|
||||
"@img/sharp-darwin-arm64@0.33.3":
|
||||
version "0.33.3"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.3.tgz#2bbf676be830c5a9ae7d9294f201c9151535badd"
|
||||
|
Loading…
x
Reference in New Issue
Block a user