Skip to content

Commit 37796af

Browse files
authored
Merge pull request #80 from GoCon/improve/button-full-width
πŸ’„ γƒœγ‚Ώγƒ³γ‚’ζœ€ε€§εΉ…γ«γ§γγ‚‹γ‚ˆγ†γ«γ—γŸ
2 parents 5b3dc04 + b8186ed commit 37796af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

β€Žsrc/components/Button.astroβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import DoubleArrow from "../assets/icon/double-arrow.svg";
44
interface Props {
55
variant?: "primary" | "secondary";
66
size?: "small" | "large";
7+
fullWidth?: boolean;
78
disabled?: boolean;
89
href?: string;
910
target?: string;
@@ -12,6 +13,7 @@ interface Props {
1213
const {
1314
variant = "primary",
1415
size = "small",
16+
fullWidth = false,
1517
disabled = false,
1618
href,
1719
target,
@@ -31,6 +33,10 @@ const {
3133
box-sizing: border-box;
3234
text-align: center;
3335
transition: background-color 0.3s ease;
36+
37+
&.full-width {
38+
width: 100%;
39+
}
3440
}
3541

3642
.button--primary {
@@ -124,7 +130,7 @@ const {
124130
</style>
125131

126132
<a
127-
class={`button button--${variant} button--${size} ${disabled ? "button--disabled" : ""}`}
133+
class={`button button--${variant} button--${size} ${disabled ? "button--disabled" : ""} ${fullWidth ? "full-width" : ""}`}
128134
href={disabled ? undefined : href}
129135
aria-disabled={disabled}
130136
role="button"

0 commit comments

Comments
Β (0)