Skip to content

Commit

Permalink
Merge pull request #50 from traP-jp/styled-buttons
Browse files Browse the repository at this point in the history
ボタンのスタイル(Bordered、Monochrome)を追加
  • Loading branch information
ZOI-dayo authored Oct 14, 2024
2 parents 0ad4d64 + 0166a63 commit f23fb9a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/components/Controls/BorderedButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
const { disabled = false } = defineProps<{
disabled?: boolean
text: string
padding?: string
}>()
const emit = defineEmits(['click'])
function onClick() {
emit('click')
}
</script>

<template>
<button
:disabled="disabled"
class="fontstyle-ui-control-strong inline-block h-9 rounded border border-brand-primary px-6 text-brand-primary enabled:hover:bg-brand-light-primary disabled:opacity-50"
:style="{paddingLeft: padding, paddingRight: padding}"
@click="onClick"
>
{{ text }}
</button>
</template>

<style scoped></style>
24 changes: 24 additions & 0 deletions src/components/Controls/MonochromeButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
const { disabled = false } = defineProps<{
disabled?: boolean
text: string
padding?: string
}>()
const emit = defineEmits(['click'])
function onClick() {
emit('click')
}
</script>

<template>
<button
:disabled="disabled"
class="fontstyle-ui-control-strong inline-block h-9 rounded border border-text-primary px-6 text-text-primary enabled:hover:bg-background-secondary disabled:opacity-50"
:style="{paddingLeft: padding, paddingRight: padding}"
@click="onClick"
>
{{ text }}
</button>
</template>

<style scoped></style>
4 changes: 3 additions & 1 deletion src/components/Controls/PrimaryButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const { disabled = false } = defineProps<{
disabled?: boolean
text: string
padding?: string
}>()
const emit = defineEmits(['click'])
function onClick() {
Expand All @@ -12,7 +13,8 @@ function onClick() {
<template>
<button
:disabled="disabled"
class="fontstyle-ui-control-strong rounded bg-brand-primary px-6 py-2 text-white enabled:hover:bg-brand-secondary disabled:opacity-50"
class="fontstyle-ui-control-strong inline-block h-9 rounded border border-brand-primary bg-brand-primary px-6 text-white enabled:hover:border-brand-secondary enabled:hover:bg-brand-secondary disabled:opacity-50"
:style="{paddingLeft: padding, paddingRight: padding}"
@click="onClick"
>
{{ text }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigations/TopNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const setMenuState = (state: boolean) => {
<button>提出一覧</button>
<PrimaryButton
v-if="!isLoggedIn"
class="px-4"
padding="1rem"
text="ログイン"
@click="
() => {
Expand Down

0 comments on commit f23fb9a

Please sign in to comment.