Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
60 changes: 60 additions & 0 deletions src/shared/components/TextInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<script setup lang="ts">
import { defineProps } from 'vue';

defineProps<{
placeholder?: string;
size: 'sm' | 'md' | 'lg';
}>();
</script>

<template>
<div class="background">
<div v-if="$slots['left']">
<slot name="left" class="side-icon" />
</div>
<input
type="text"
class="text-input"
:size="size"
:placeholder="placeholder"
/>
<div v-if="$slots['right']">
<slot name="right" class="side-icon" />
</div>
</div>
</template>

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

Choose a reason for hiding this comment

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

1px solid $color-border で良さそうな気がする! radius はここでは指定できないので別で指定してあげる必要がある

ref: https://developer.mozilla.org/ja/docs/Web/CSS/border

1px solid,
$color-border border-color,
1px solid radius;
}
.background:focus-within {
outline: 2px solid;
Copy link
Contributor

Choose a reason for hiding this comment

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

outline は primary-color とかの方が良い感じかも

outline-color: $color-primary;
}
.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;
Copy link
Contributor

Choose a reason for hiding this comment

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

opacity: 1 は特に意味のないCSSかも…?

}
.side-icon {
display: flex;
padding: 0 4px;
height: 32px;
align-items: center;
}
</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