-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textInput を実装 #61
base: main
Are you sure you want to change the base?
textInput を実装 #61
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script setup lang="ts"> | ||
import { defineProps } from 'vue'; | ||
|
||
const props = defineProps<{ | ||
placeholder: string; | ||
size: number; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div class="background"> | ||
<slot name="left" /> | ||
<input | ||
type="text" | ||
class="text-input" | ||
:size="props.size" | ||
:placeholder="props.placeholder" | ||
/> | ||
<slot name="right" /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.background { | ||
display: inline flex; | ||
gap: 8px; | ||
height: 32px; | ||
align-items: center; | ||
padding: 8px 16px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [should] 外側の |
||
border-color: $color-border; | ||
border: 1px solid; | ||
border-radius: 4px; | ||
} | ||
.text-input { | ||
height: 32px; | ||
border: none; | ||
outline: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [should] アクセシビリティの観点から |
||
font-size: 16px; | ||
font-weight: 500; | ||
background-color: transparent; | ||
} | ||
.text-input::placeholder { | ||
color: $color-text-placeholder; | ||
opacity: 1; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imo]
props.placeholder
とかはplaceholder
ってした方が簡単に書けるかも