diff --git a/astro.config.mjs b/astro.config.mjs index 8140cc7..5a267f1 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,11 +2,12 @@ import { defineConfig } from 'astro/config' import mdx from '@astrojs/mdx' import tailwind from '@astrojs/tailwind' import compress from 'astro-compress' +import icon from "astro-icon" // https://astro.build/config export default defineConfig({ compressHTML: true, - integrations: [mdx(), tailwind({ + integrations: [mdx(), icon(), tailwind({ applyBaseStyles: false, }), compress()], }) diff --git a/package.json b/package.json index c223ddd..6e96b64 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,14 @@ "@astrojs/mdx": "^2.0.2", "@astrojs/partytown": "^2.0.2", "@astrojs/tailwind": "^5.0.4", + "@iconify-json/ion": "^1.1.15", + "@iconify-json/mdi": "^1.1.64", "@typescript-eslint/eslint-plugin": "^5.50.0", "@typescript-eslint/parser": "^5.50.0", "accessible-astro-components": "^2.3.3", "astro": "^4.0.7", "astro-compress": "^2.0.6", - "astro-icon": "^0.7.3", + "astro-icon": "^1.0.2", "eslint": "^8.33.0", "eslint-plugin-astro": "^0.23.0", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -27,7 +29,7 @@ "prettier-plugin-astro": "^0.8.0", "prettier-plugin-tailwindcss": "^0.2.2", "sass": "^1.49.9", - "svgo": "^2.8.0", + "svgo": "^3.2.0", "tailwindcss": "^3.2.7" } } diff --git a/src/assets/scss/base/_button.scss b/src/assets/scss/base/_button.scss index 0b35a99..b205d4a 100644 --- a/src/assets/scss/base/_button.scss +++ b/src/assets/scss/base/_button.scss @@ -134,7 +134,8 @@ align-items: center; gap: 0.5rem; - [astro-icon] { + [data-icon] { + height: auto; width: 30px; } } diff --git a/src/components/Feature.astro b/src/components/Feature.astro index 351a11a..98cc7fb 100644 --- a/src/components/Feature.astro +++ b/src/components/Feature.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon' +import { Icon } from 'astro-icon/components' const { icon = 'mdi:rocket', title = 'Title' } = Astro.props --- @@ -54,7 +54,8 @@ const { icon = 'mdi:rocket', title = 'Title' } = Astro.props } } - :global(.feature [astro-icon]) { + :global(.feature [data-icon]) { + height: auto; width: 4rem; color: var(--action-color); } diff --git a/src/components/Header.astro b/src/components/Header.astro index 8da7be6..7106f96 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,7 +1,7 @@ --- import Navigation from '../components/Navigation.astro' import { SkipLinks } from 'accessible-astro-components' -import { Icon } from 'astro-icon' +import { Icon } from 'astro-icon/components' ---
@@ -32,7 +32,7 @@ import { Icon } from 'astro-icon' @@ -45,7 +45,8 @@ import { Icon } from 'astro-icon' .type-icon a { display: block; - [astro-icon] { + [data-icon] { + height: auto; margin-top: -4px; width: 30px; @@ -55,7 +56,7 @@ import { Icon } from 'astro-icon' } &:hover { - [astro-icon] path { + [data-icon] path { fill: var(--action-color-state); } } diff --git a/src/components/Hero.astro b/src/components/Hero.astro index 3a33d51..b24df03 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon' +import { Icon } from 'astro-icon/components' const { src = '/astronaut-hero-img.webp' } = Astro.props --- @@ -13,14 +13,14 @@ const { src = '/astronaut-hero-img.webp' } = Astro.props
- + Star on GitHub - + Read the Docs
diff --git a/src/pages/accessible-components.astro b/src/pages/accessible-components.astro index 37be575..5eda212 100644 --- a/src/pages/accessible-components.astro +++ b/src/pages/accessible-components.astro @@ -1,6 +1,6 @@ --- import DefaultLayout from '../layouts/DefaultLayout.astro' -import { Icon } from 'astro-icon' +import { Icon } from 'astro-icon/components' import { Accordion, AccordionItem, @@ -112,26 +112,26 @@ import {

Notification

-

Message: This is a notification!

+

Message: This is a notification!

-

+

Info: This is a notification of type info.

-

+

Success: This is a notification of type success.

-

+

Warning: This is a notification of type warning and goes on multiple lines to see how that looks.

-

+

Error: This is a notification of type error.

diff --git a/src/pages/mdx-page.mdx b/src/pages/mdx-page.mdx index 249a420..64a9db1 100644 --- a/src/pages/mdx-page.mdx +++ b/src/pages/mdx-page.mdx @@ -3,13 +3,13 @@ layout: ../layouts/MarkdownLayout.astro title: MDX Page --- -import { Icon } from 'astro-icon' +import { Icon } from 'astro-icon/components' import { Notification } from 'accessible-astro-components' # MDX Page - +

Info: This page utilizes Astro's MDX feature which let's you use components in a markdown file and supports out-of-the-box syntax highlighting with Shiki.