-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
import { handleStyleProps, StyleProps } from '@/utils/handleStyleProps'; | ||
import type { HTMLTag, Polymorphic } from 'astro/types'; | ||
import { PrimaryShades } from '@/utils/types'; | ||
type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & { shade?: PrimaryShades } & StyleProps; | ||
const { as: Tag = 'button', style: ogStyles, shade, class: className, ...props } = Astro.props; | ||
console.log(ogStyles); | ||
const styles = { | ||
backgroundColor: props.shade ? `rgb(var(--primary-${shade}))` : '', | ||
boxShadow: props.shade | ||
? `0px 0px 36px 0px rgb(var(--primary-${shade < 1200 ? shade + 100 : shade}), 0.3)` | ||
: '', | ||
...ogStyles, | ||
...handleStyleProps(props), | ||
}; | ||
--- | ||
|
||
<style lang='scss'> | ||
.root { | ||
padding: 0.5rem 1rem; | ||
background-color: rgb(var(--primary-300)); | ||
box-shadow: 0px 0px 32px 0px rgba(var(--primary-400), 0.4); | ||
border-radius: var(--radius); | ||
color: var(--text-color); | ||
text-decoration: none; | ||
font-weight: 600; | ||
} | ||
</style> | ||
<Tag {...props} style={styles} class:list={['root', className]}> | ||
<slot /> | ||
</Tag> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
--- | ||
import Button from '@/components/Button.astro'; | ||
import Hero from '@/components/Hero.astro'; | ||
import Stack from '@/components/Stack.astro'; | ||
import BaseLayout from '@/layouts/BaseLayout.astro'; | ||
--- | ||
|
||
<BaseLayout description='Milky Web brings a galaxy of web infrastructure into your hands.'> | ||
<Hero /> | ||
<Stack align='center'> | ||
<Hero /> | ||
<Button as='a' href='/posts' p='0.75rem 1.25rem' style={{ fontSize: '1.5rem' }} | ||
>View Posts</Button | ||
> | ||
</Stack> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters