-
Notifications
You must be signed in to change notification settings - Fork 0
textInput を実装 #61
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
Changes from 3 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,58 @@ | ||
| <script setup lang="ts"> | ||
| import { defineProps } from 'vue'; | ||
|
|
||
| defineProps<{ | ||
| placeholder: string; | ||
| size: number; | ||
|
||
| }>(); | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="background"> | ||
| <div v-if="$slots['left']" class="side-icon"> | ||
| <slot name="left" /> | ||
| </div> | ||
|
||
| <input | ||
| type="text" | ||
| class="text-input" | ||
| :size="size" | ||
| :placeholder="placeholder" | ||
| /> | ||
| <div v-if="$slots['right']" class="side-icon"> | ||
| <slot name="right" /> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style lang="scss" scoped> | ||
| .background { | ||
| display: inline flex; | ||
| height: 32px; | ||
| align-items: center; | ||
| border-color: $color-border; | ||
| border: 1px solid; | ||
|
||
| border-radius: 4px; | ||
| } | ||
| .background:focus-within { | ||
| outline: 2px solid; | ||
|
Contributor
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. outline は primary-color とかの方が良い感じかも |
||
| } | ||
| .text-input { | ||
| height: 32px; | ||
| padding: 8px 8px; | ||
| border: none; | ||
| outline: none; | ||
| font-size: 16px; | ||
| font-weight: 500; | ||
| background-color: transparent; | ||
| } | ||
| .text-input::placeholder { | ||
| color: $color-text-placeholder; | ||
| opacity: 1; | ||
|
||
| } | ||
| .side-icon { | ||
| display: flex; | ||
| padding: 0 4px; | ||
| height: 32px; | ||
| align-items: center; | ||
| } | ||
| </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.
placeholder は optional にしてほしい!