Skip to content

Conversation

@ramong26
Copy link
Owner

📝 PR 제목

슬라이더 on off 색깔 변경 및 스위치 스타일 재수정

🛠 변경 내용

  • 슬라이더 on off 색깔 변경
  • 스위치 스타일 재수정

🎯 목적 / 이유

  • 스위치 스타일 이상해짐
  • 슬라이더 on off 시각적 구분 필요함

✅ 확인 사항

  • 빌드 통과 ✅
  • 테스트 통과 ✅
  • 불필요한 console.log 제거 ✅

@ramong26 ramong26 requested a review from Copilot September 20, 2025 05:22
@ramong26 ramong26 self-assigned this Sep 20, 2025
@ramong26 ramong26 added the refactor refatoring code or style label Sep 20, 2025
@ramong26 ramong26 linked an issue Sep 20, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @ramong26, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 슬라이더와 스위치 컴포넌트의 시각적 일관성과 사용자 경험을 개선하는 데 중점을 둡니다. 기존에 스위치 스타일이 이상했던 문제를 해결하고, 슬라이더의 on/off 상태를 색상으로 명확하게 구분하여 사용자가 현재 상태를 쉽게 인지할 수 있도록 하였습니다.

Highlights

  • 슬라이더 색상 변경: 슬라이더의 on/off 상태에 따른 시각적 구분을 명확히 하기 위해 색상이 변경되었습니다.
  • 스위치 스타일 재조정: 스위치 컴포넌트의 스타일이 재조정되어, 기본 상태와 활성화 상태의 색상이 명확하게 구분됩니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Switch and Slider components to improve visual styling and color differentiation. The changes focus on enhancing the switch's on/off visual states and restructuring the slider's cross-browser styling approach.

  • Modified switch thumb colors to provide better visual distinction between on/off states
  • Restructured slider CSS to use separate webkit and moz selectors for improved cross-browser compatibility
  • Updated slider dimensions and styling properties for consistency

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/components/Switch/Switch.scss Updated thumb colors for better on/off state distinction
src/components/Slider/Slider.scss Restructured CSS with separate track and thumb selectors for cross-browser support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

&::-webkit-slider-thumb {
-webkit-appearance: none;
margin-top: -8px;
appearance: none;
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

The appearance: none property is redundant since -webkit-appearance: none already handles this for webkit browsers. Consider removing the duplicate declaration.

Suggested change
appearance: none;

Copilot uses AI. Check for mistakes.
background: s.color(white) url('../../assets/paper.png');
background-size: cover;
cursor: pointer;
border-radius: 0;
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

The Firefox thumb selector is missing the hover state and transition properties that are defined for the webkit version. This creates inconsistent behavior across browsers.

Suggested change
border-radius: 0;
border-radius: 0;
transition: all 0.15s ease-in-out;
&:hover {
background: s.color(yellow-600) url('../../assets/paper.png');
transform: scale(1.1);
}

Copilot uses AI. Check for mistakes.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 슬라이더와 스위치 컴포넌트의 스타일을 개선하는 내용을 담고 있습니다. 슬라이더의 경우, 브라우저 호환성을 위해 각기 다른 의사 요소(pseudo-element) 스타일을 분리한 점이 좋습니다. 스위치는 on/off 상태에 따라 색상이 변경되도록 수정하여 시각적 구분이 명확해졌습니다.

코드 리뷰에서는 몇 가지 개선점을 제안했습니다.

  • Slider.scss에서 코드 중복을 줄이고 브라우저 간 일관성을 높이는 방법을 제안했습니다. 특히 반응형 스타일에서 발생할 수 있는 문제를 지적했습니다.
  • Switch.scss에서는 색상 변경 애니메이션이 부드럽게 동작하도록 transition 속성을 수정할 것을 제안했습니다.

전반적으로 컴포넌트의 사용성과 유지보수성을 향상시키는 좋은 리팩터링이라고 생각합니다.

Comment on lines 35 to 62
&::-webkit-slider-thumb {
-webkit-appearance: none;
margin-top: -8px;
appearance: none;
width: 20px;
height: 20px;
border: 2px solid s.color(black);
background: s.color(white) url('../../assets/paper.png');
background-size: cover;
cursor: pointer;
transition: all 0.15s ease-in-out;
border-radius: 0;

&:hover {
background: s.color(yellow-600) url('../../assets/paper.png');
transform: scale(1.1);
}
}

&::-moz-range-track {
height: 10px;
&::-moz-range-thumb {
width: 20px;
height: 20px;
border: 2px solid s.color(black);
background: s.color(white) url('../../assets/paper.png');
background-size: cover;
cursor: pointer;
border-radius: 0;
}

Choose a reason for hiding this comment

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

high

::-webkit-slider-thumb::-moz-range-thumb에 중복되는 스타일이 많습니다. 믹스인을 사용해 중복을 줄일 수 있습니다.

더 중요한 점은, ::-moz-range-thumbtransition:hover 효과가 누락되어 브라우저 간에 시각적 불일치가 발생합니다. 일관된 사용자 경험을 위해 이를 추가하는 것이 좋습니다.

또한, 이 파일의 미디어 쿼리(@include s.mq(...)) 내에서 ::-webkit-slider-thumb::-moz-range-thumb가 쉼표로 구분되어 함께 선택되어 있는데, 이는 일부 브라우저에서 스타일이 적용되지 않는 원인이 될 수 있습니다. 여기서 분리하신 것처럼 미디어 쿼리 안에서도 각 브라우저별 선택자를 분리하여 스타일을 적용해야 합니다.

Comment on lines +19 to +32
&::-webkit-slider-runnable-track {
height: 8px;
border: 2px solid s.color(black);
background: s.color(white) url('../../assets/paper.png');
background-size: cover;
}

// 트랙 (파이어폭스)
&::-moz-range-track {
height: 8px;
border: 2px solid s.color(black);
background: s.color(white) url('../../assets/paper.png');
background-size: cover;
}

Choose a reason for hiding this comment

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

medium

::-webkit-slider-runnable-track::-moz-range-track의 스타일이 동일합니다. 코드 중복을 줄이고 유지보수성을 높이기 위해 SCSS 믹스인(mixin)을 활용하는 것을 고려해 보세요.

예시:

@mixin slider-track-styles {
  height: 8px;
  border: 2px solid s.color(black);
  background: s.color(white) url('../../assets/paper.png');
  background-size: cover;
}

.slider__input {
  // ...
  &::-webkit-slider-runnable-track {
    @include slider-track-styles;
  }

  &::-moz-range-track {
    @include slider-track-styles;
  }
}

height: $thumb-size;
background: s.color(red-300);
background: s.color(gray-500);
transition: left 0.3s;

Choose a reason for hiding this comment

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

medium

스위치가 켜질 때 배경색이 바뀌도록 수정하셨는데, ::before 요소의 transition 속성에 background가 포함되지 않아 색상 변경이 즉시 일어납니다. 부드러운 전환 효과를 위해 transition 속성을 수정하는 것이 좋습니다.

Suggested change
transition: left 0.3s;
transition: left 0.3s, background 0.3s;

@ramong26 ramong26 merged commit 6682098 into main Sep 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor refatoring code or style

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor/slider-switch]

2 participants