Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/shared/components/TextInput.vue
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[imo] props.placeholder とかは placeholder ってした方が簡単に書けるかも

/>
<slot name="right" />
</div>
</template>

<style lang="scss" scoped>
.background {
display: inline flex;
gap: 8px;
height: 32px;
align-items: center;
padding: 8px 16px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[should] 外側の <div> に padding 付けちゃうと周辺のエリアが <input> じゃなくなっちゃうので、<input> の方の padding で対応して欲しいです!

border-color: $color-border;
border: 1px solid;
border-radius: 4px;
}
.text-input {
height: 32px;
border: none;
outline: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[should] アクセシビリティの観点から outilne: 0 は外して欲しいです! (どこにフォーカスが当たっているのかを分かりやすくするため)

font-size: 16px;
font-weight: 500;
background-color: transparent;
}
.text-input::placeholder {
color: $color-text-placeholder;
opacity: 1;
}
</style>
2 changes: 2 additions & 0 deletions src/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $color-secondary: #e2e2e2;
$color-secondary-hover: #f0f0f0;
$color-secondary-disabled: #c9cac9;

$color-border: #414143;
$color-border-hover: #2b2b2b;
$color-error: #ff4500;

Expand All @@ -18,6 +19,7 @@ $color-text-secondary-pale: #5151515d;
$color-text-secondary-disabled: #939393;
$color-text-white: #ffffff;
$color-text-dimmed: #626264;
$color-text-placeholder: #757578;

$color-container-primary: #dcefdd;
$color-container-secondary: #f1f1f4;
Expand Down
Loading