Skip to content

Commit

Permalink
refactor: css only
Browse files Browse the repository at this point in the history
  • Loading branch information
Arucard89 committed Jul 4, 2024
1 parent f47d473 commit 8115a71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ $blockButton: '.#{variables.$ns}select-control__button';
@include mixins.button-reset();
@include mixins.pin($blockButton, ('::before', '::after'), var(--_--border-radius));

display: inline-flex;
display: inline-grid;
grid-template-columns: auto auto;
align-items: center;
justify-content: flex-start;
overflow: hidden;
width: 100%;
height: 100%;
Expand Down Expand Up @@ -209,11 +211,6 @@ $blockButton: '.#{variables.$ns}select-control__button';
transform: scale(0.96);
}

&__content-container {
display: grid;
grid-template-columns: auto auto;
}

&__label {
@include mixins.text-accent;
@include mixins.overflow-ellipsis();
Expand Down
20 changes: 9 additions & 11 deletions src/components/Select/components/SelectControl/SelectControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,15 @@ export const SelectControl = React.forwardRef<HTMLButtonElement, ControlProps>((
data-qa={qa}
title={title}
>
<div className={selectControlBlock('content-container')}>
{label && <span className={selectControlBlock('label')}>{label}</span>}
{showPlaceholder && (
<span className={selectControlBlock('placeholder')}>{placeholder}</span>
)}
{showOptionsText && (
<span className={selectControlBlock('option-text')}>
{selectedOptionsContent}
</span>
)}
</div>
{label && <span className={selectControlBlock('label')}>{label}</span>}
{showPlaceholder && (
<span className={selectControlBlock('placeholder')}>{placeholder}</span>
)}
{showOptionsText && (
<span className={selectControlBlock('option-text')}>
{selectedOptionsContent}
</span>
)}
</button>
{renderCounterComponent()}
{renderClearIcon({})}
Expand Down

0 comments on commit 8115a71

Please sign in to comment.