Skip to content

Commit

Permalink
refactor: css only decision
Browse files Browse the repository at this point in the history
  • Loading branch information
Arucard89 committed Oct 10, 2024
1 parent 96d0147 commit 4c2632a
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 @@ -201,17 +201,15 @@ export const SelectControl = React.forwardRef<HTMLButtonElement, ControlProps>((
tabIndex={0}
{...triggerProps}
>
<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 4c2632a

Please sign in to comment.