Skip to content

Commit

Permalink
feat: 모바일 디바이스(ios)에서 <input>, <textarea> 포커스 시 자동 zoom-in되는 현상 개선 (#492
Browse files Browse the repository at this point in the history
)

* refactor/#491: 불필요한 코드 삭제

* feat/#491: 글로벌스타일 수정

* fix/#491: 데스크톱 사파리에서 네모로 나오는 라벨 디자인 수정

* feat/#491: 모바일 화면에서 zoom-in되지 않도록 폰트 사이즈 설정

* feat/#491: select border-radius 기본 스타일 제거

* refactor/#491: 중복 css 코드 삭제
  • Loading branch information
HyeryongChoi authored Oct 17, 2023
1 parent b0ad7ac commit 1a014f6
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 45 deletions.
3 changes: 2 additions & 1 deletion frontend/src/components/@common/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const InputWrapper = styled.input<InputStyleProps>`
height: 100%;
padding: 1.2rem;
font-size: ${({ $fontSize }) => $fontSize || '1.4rem'};
font-size: ${({ $fontSize }) =>
($fontSize && $fontSize < '1.6rem') || !$fontSize ? '16px' : $fontSize};
border: none;
outline: none;
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/components/@common/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,11 @@ const LabelWrapper = styled.div<LabelStyleProps>`
background-color: ${({ $clicked, theme, $backgroundColor }) =>
$clicked ? theme.color.blue : $backgroundColor};
border: 1px solid ${({ theme }) => theme.color.blue};
border-radius: 20px;
${({ $hasBorder, $clicked, $borderColor }) =>
$hasBorder &&
!$clicked &&
`
outline: 1px solid ${$borderColor};
outline-offset: -1px;
`}
$hasBorder && !$clicked && `border-color: ${$borderColor};`}
${({ onClick }) => onClick && 'cursor: pointer'};
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,21 @@ const MainIngredientsFilterList = (props: MainIngredientsFilterListProps) => {

return (
<MainIngredientsFilterListLayout>
{filterList
.concat(filterList)
.concat(filterList)
.concat(filterList)
.concat(filterList)
.concat(filterList)
.map(({ id, ingredients }) => {
const selected = selectedFilterList[MAIN_INGREDIENTS].has(ingredients);

return (
<IngredientFilterItem
role="checkbox"
key={id}
aria-checked={selected}
$selected={selected}
onClick={() => toggleFilter(MAIN_INGREDIENTS, ingredients)}
>
{ingredients}
</IngredientFilterItem>
);
})}
{filterList.map(({ id, ingredients }) => {
const selected = selectedFilterList[MAIN_INGREDIENTS].has(ingredients);

return (
<IngredientFilterItem
role="checkbox"
key={id}
aria-checked={selected}
$selected={selected}
onClick={() => toggleFilter(MAIN_INGREDIENTS, ingredients)}
>
{ingredients}
</IngredientFilterItem>
);
})}
</MainIngredientsFilterListLayout>
);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/PetProfile/PetAgeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const AgeSelect = styled.select`
width: 100%;
padding: 1.2rem;
font-size: 1.3rem;
font-size: 1.6rem;
color: ${({ theme }) => theme.color.grey600};
border: none;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/PetProfile/PetBreedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const BreedSelect = styled.select`
width: 100%;
padding: 1.2rem;
font-size: 1.3rem;
font-size: 1.6rem;
color: ${({ theme }) => theme.color.grey600};
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const Kg = styled.p`
top: 1.2rem;
right: 1.2rem;
font-size: 1.3rem;
font-size: 1.6rem;
font-weight: 500;
line-height: 1.7rem;
color: ${({ theme }) => theme.color.grey600};
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/Review/ReviewForm/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const DetailReviewText = styled.textarea<{ $isValid: boolean }>`
min-height: 12rem;
padding: 1.2rem;
font-size: 1.6rem;
line-height: 2.4rem;
color: ${({ theme }) => theme.color.grey500};
Expand All @@ -168,7 +167,7 @@ const SubmitButton = styled.button`
width: 100vw;
height: 9rem;
font-size: 1.6rem;
font-size: 2rem;
font-weight: 700;
line-height: 2.4rem;
color: ${({ theme }) => theme.color.white};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ const Select = styled.select<StyledProps>`
color: ${({ theme }) => theme.color.grey400};
text-align: center;
/* stylelint-disable-next-line CssSyntaxError */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: ${({ theme }) => theme.color.grey200};
border: none;
border-radius: 4px;
Expand All @@ -64,7 +60,6 @@ const Select = styled.select<StyledProps>`
$skeleton &&
css`
${theme.animation.skeleton}
appearance: none;
border-radius: 4px;
`};
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,6 @@ const Select = styled.select`
color: ${({ theme }) => theme.color.grey400};
text-align: center;

/* stylelint-disable-next-line CssSyntaxError */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: 1px solid ${({ theme }) => theme.color.grey400};
border-radius: 16px;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const PetProfileNameAddition = (props: PetProfileNameAdditionProps) => {
isValid={isFirstRenderedOrValidInput}
onChange={onChangeName}
design="underline"
fontSize="1.3rem"
/>
<ErrorCaption>
{!isFirstRenderedOrValidInput &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const PetProfileWeightAddition = (props: PetProfileWeightAddition) => {
isValid={isFirstRenderedOrValidInput}
onChange={onChangeWeight}
design="underline"
fontSize="1.3rem"
inputMode="decimal"
/>
<Kg>kg</Kg>
Expand Down Expand Up @@ -109,7 +108,7 @@ const Kg = styled.p`
top: 1.2rem;
right: 1.2rem;
font-size: 1.3rem;
font-size: 1.6rem;
font-weight: 500;
line-height: 1.7rem;
color: ${({ theme }) => theme.color.grey600};
Expand Down
23 changes: 23 additions & 0 deletions frontend/src/styles/globalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ const globalStyle = css`
button {
cursor: pointer;
}
input,
textarea {
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
font-size: 16px;
-webkit-appearance: none;
appearance: none;
-webkit-border-radius: 0;
border-radius: 0;
}
select {
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
font-size: 16px;
-webkit-appearance: none;
appearance: none;
background-color: transparent;
-webkit-border-radius: 0;
border-radius: 0;
outline: none;
}
`;

export default globalStyle;

0 comments on commit 1a014f6

Please sign in to comment.