diff --git a/.vscode/css-custom-data.json b/.vscode/css-custom-data.json new file mode 100644 index 0000000..56e07f6 --- /dev/null +++ b/.vscode/css-custom-data.json @@ -0,0 +1,17 @@ +{ + "version": 1.1, + "atDirectives": [ + { + "name": "@tailwind", + "description": "@tailwind tailwindcss" + }, + { + "name": "@layer", + "description": "@layer tailwindcss" + }, + { + "name": "@apply", + "description": "@apply tailwindcss" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index e482bb3..be6ddaf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "css.customData": ["./vscode/css-custom-data.json"], "eslint.validate": [ "javascript", "javascriptreact", diff --git a/src/assets/styles/base.css b/src/assets/styles/base.css index 8c1c226..c623a4c 100644 --- a/src/assets/styles/base.css +++ b/src/assets/styles/base.css @@ -3,21 +3,33 @@ @tailwind utilities; @layer components { - .btn { - @apply inline-flex items-center justify-center rounded-full shadow-md border-gray-400 border bg-transparent font-medium text-center text-base text-gray-700 leading-snug transition py-3.5 px-6 md:px-8 ease-in duration-200 focus:ring-blue-500 focus:ring-offset-blue-200 focus:ring-2 focus:ring-offset-2 hover:bg-gray-100 hover:border-gray-600 dark:text-slate-300 dark:border-slate-500 dark:hover:bg-slate-800 dark:hover:border-slate-800; + .text-page { + color: var(--aw-color-text-page); } - .btn-ghost { - @apply border-none shadow-none text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white; + .text-muted { + color: var(--aw-color-text-muted); } - .btn-primary { - @apply font-semibold bg-primary-800 text-white border-primary-800 hover:bg-primary-900 hover:border-primary-900 hover:text-white dark:text-white dark:bg-primary-800 dark:border-primary-800 dark:hover:border-primary-900 dark:hover:bg-primary-900; + .bg-light { + background-color: var(--aw-color-bg-page); } .bg-dark { @apply bg-slate-900; } + + .btn { + @apply inline-flex items-center justify-center rounded-full shadow-md border-gray-400 border bg-transparent font-medium text-center text-base text-page leading-snug transition py-3.5 px-6 md:px-8 ease-in duration-200 focus:ring-blue-500 focus:ring-offset-blue-200 focus:ring-2 focus:ring-offset-2 hover:bg-gray-100 hover:border-gray-600 dark:text-slate-300 dark:border-slate-500 dark:hover:bg-slate-800 dark:hover:border-slate-800; + } + + .btn-ghost { + @apply border-none shadow-none text-muted hover:text-gray-900 dark:text-gray-400 dark:hover:text-white; + } + + .btn-primary { + @apply font-semibold bg-primary text-white border-primary hover:bg-blue-900 hover:border-blue-900 hover:text-white dark:text-white dark:bg-primary dark:border-primary dark:hover:border-blue-900 dark:hover:bg-blue-900; + } } #header.scroll { diff --git a/src/components/blog/GridItem.astro b/src/components/blog/GridItem.astro index 95fd1ed..a873018 100644 --- a/src/components/blog/GridItem.astro +++ b/src/components/blog/GridItem.astro @@ -39,12 +39,12 @@ const image = await findImage(post.image); ) : ( {post.title} ) } -

{post.excerpt || post.description}

+

{post.excerpt || post.description}

diff --git a/src/components/blog/HighlightedPosts.astro b/src/components/blog/HighlightedPosts.astro index 08932dc..875ab84 100644 --- a/src/components/blog/HighlightedPosts.astro +++ b/src/components/blog/HighlightedPosts.astro @@ -37,7 +37,7 @@ const posts = await findPostsByIds(postIds); { allPostsText && allPostsLink && ( {allPostsText} » @@ -46,7 +46,7 @@ const posts = await findPostsByIds(postIds); } - {information &&

} + {information &&

} diff --git a/src/components/blog/LatestPosts.astro b/src/components/blog/LatestPosts.astro index ad8efa7..e608b22 100644 --- a/src/components/blog/LatestPosts.astro +++ b/src/components/blog/LatestPosts.astro @@ -4,27 +4,50 @@ import Grid from '~/components/blog/Grid.astro'; import { getBlogPermalink } from '~/utils/permalinks'; import { findLatestPosts } from '~/utils/blog'; -const count = 4; +export interface Props { + title?: string; + allPostsText?: string; + allPostsLink?: string | URL; + information?: string; + postIds: string[]; +} + +const { + title = await Astro.slots.render('title'), + allPostsText = 'View all posts', + allPostsLink = getBlogPermalink(), + information = await Astro.slots.render('information'), + count = 4, +} = Astro.props; + const posts = await findLatestPosts({ count }); --- -

-
-

- Latest articles in our Blog - -

+
+
+
+ { + title && ( +

+ ) + } + { + allPostsText && allPostsLink && ( + + {allPostsText} » + + ) + } +

-

- The blog will be used to display AstroWind documentation. Each new article will be an important step that you will - need to know to be an expert in creating a website using Astro + Tailwind CSS The blog does not exist yet, but - very soon. Astro is a very interesting technology. Thanks. -

+ {information &&

}

-
+
\ No newline at end of file diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro index d4697dd..06fe825 100644 --- a/src/components/blog/ListItem.astro +++ b/src/components/blog/ListItem.astro @@ -1,7 +1,7 @@ --- import Icon from 'astro-icon'; import { Picture } from '@astrojs/image/components'; -import PostTags from '~/components/common/Tags.astro'; +import PostTags from '~/components/blog/Tags.astro'; import { BLOG } from '~/config.mjs'; import type { Post } from '~/types'; @@ -43,15 +43,15 @@ const link = !BLOG?.post?.disabled ? getPermalink(post.slug, 'post') : '';
- + ~ {Math.ceil(post.readingTime)} min read
-

+

{ link ? ( - + {post.title} ) : ( @@ -61,7 +61,7 @@ const link = !BLOG?.post?.disabled ? getPermalink(post.slug, 'post') : '';

- {post.excerpt &&

{post.excerpt}

} + {post.excerpt &&

{post.excerpt}

} diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro index 3aa6756..32b7f1a 100644 --- a/src/components/blog/SinglePost.astro +++ b/src/components/blog/SinglePost.astro @@ -2,7 +2,7 @@ import Icon from 'astro-icon'; import { Picture } from '@astrojs/image/components'; -import PostTags from '~/components/common/Tags.astro'; +import PostTags from '~/components/blog/Tags.astro'; import SocialShare from '~/components/common/SocialShare.astro'; import { getFormattedDate } from '~/utils/utils'; @@ -22,10 +22,10 @@ const { post, url } = Astro.props;

- - ~ { - Math.ceil(post.readingTime) - } min read + + ~ { + Math.ceil(post.readingTime) + } min read

{post.excerpt}

@@ -60,7 +60,7 @@ const { post, url } = Astro.props; }

{ post.Content ? ( diff --git a/src/components/common/Tags.astro b/src/components/blog/Tags.astro similarity index 86% rename from src/components/common/Tags.astro rename to src/components/blog/Tags.astro index a285652..122cd91 100644 --- a/src/components/common/Tags.astro +++ b/src/components/blog/Tags.astro @@ -22,7 +22,7 @@ const { tags, class: className = 'text-sm' } = Astro.props; ) : ( {tag} diff --git a/src/components/common/CustomStyles.astro b/src/components/common/CustomStyles.astro new file mode 100644 index 0000000..8d60d9b --- /dev/null +++ b/src/components/common/CustomStyles.astro @@ -0,0 +1,23 @@ +--- +import '@fontsource/inter/variable.css'; + +// Nunito +// Dosis +--- + + + + diff --git a/src/components/common/Fonts.astro b/src/components/common/Fonts.astro deleted file mode 100644 index c455323..0000000 --- a/src/components/common/Fonts.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- -import '@fontsource/inter/variable.css'; ---- - - diff --git a/src/components/common/MetaTags.astro b/src/components/common/MetaTags.astro index 1a413d0..d30e34f 100644 --- a/src/components/common/MetaTags.astro +++ b/src/components/common/MetaTags.astro @@ -5,10 +5,10 @@ import { getImage } from '@astrojs/image'; import { SITE } from '~/config.mjs'; import { MetaSEO } from '~/types'; -import { getCanonical, getAsset } from '~/utils/permalinks'; +import { getCanonical, getAsset } from '~/utils/permalinks'; import { getRelativeUrlByFilePath } from '~/utils/directories'; -import Fonts from '~/components/common/Fonts.astro'; +import CustomStyles from '~/components/common/CustomStyles.astro'; import SplitbeeAnalytics from './SplitbeeAnalytics.astro'; export interface Props extends MetaSEO { @@ -82,7 +82,7 @@ const image = }} /> - + {SITE.googleSiteVerificationId && } diff --git a/src/components/common/SocialShare.astro b/src/components/common/SocialShare.astro index ae26912..91282c9 100644 --- a/src/components/common/SocialShare.astro +++ b/src/components/common/SocialShare.astro @@ -11,20 +11,35 @@ const { text, url, class: className = 'inline-block' } = Astro.props; ---
- Share: + Share:
diff --git a/src/components/common/ToggleTheme.astro b/src/components/common/ToggleTheme.astro index a49986e..5591ad0 100644 --- a/src/components/common/ToggleTheme.astro +++ b/src/components/common/ToggleTheme.astro @@ -13,7 +13,7 @@ export interface Props { const { label = 'Toggle between Dark and Light mode', class: - className = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center', + className = 'text-muted dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center', iconClass = 'w-6 h-6', iconName = 'tabler:sun', } = Astro.props; diff --git a/src/components/widgets/Announcement.astro b/src/components/widgets/Announcement.astro index be58a2b..41a2586 100644 --- a/src/components/widgets/Announcement.astro +++ b/src/components/widgets/Announcement.astro @@ -3,9 +3,9 @@ import { getPermalink } from '~/utils/permalinks'; ---