Skip to content

Commit

Permalink
fix(switch): add
Browse files Browse the repository at this point in the history
  • Loading branch information
koory1st committed Feb 15, 2024
1 parent d54838f commit 6435b97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
29 changes: 0 additions & 29 deletions packages/switch/src/lib/switch.svelte
Original file line number Diff line number Diff line change
@@ -1,31 +1,2 @@
<script>
import a2s from '@svelement-ui/util-array-2-class-string';
import SvelInput from '@svelement-ui/input';
import SvelTooltip from '@svelement-ui/tooltip';
import { getContext } from 'svelte';
export let value;
let tooltipVisible = false;
$: dark = dark || getContext('svel-dark');
function handleInputClick() {
console.log(tooltipVisible);
tooltipVisible = true;
}
function handleInputBlur() {
tooltipVisible = false;
}
</script>

<SvelTooltip visible={tooltipVisible}>
<div
aria-controls="svel-id-6711-108"
aria-expanded="false"
aria-haspopup="listbox"
role="combobox"
>
<SvelInput bind:value on:blur={handleInputBlur} on:focus={handleInputClick} />
</div>
<div slot="content">11111111111111111</div>
</SvelTooltip>
11 changes: 2 additions & 9 deletions packages/theme-chalk/src/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,7 @@ $switch-content-padding: map.merge(
align-items: center;
min-width: map.get($switch-core-width, 'default');
height: map.get($switch-core-height, 'default');
border: 1px solid
var(
#{getCssVarName('switch-border-color')},
#{getCssVar('switch-off-color')}
);
border: 1px solid var(#{getCssVarName('switch-border-color')}, #{getCssVar('switch-off-color')});
outline: none;
border-radius: map.get($switch-core-border-radius, 'default');
box-sizing: border-box;
Expand Down Expand Up @@ -202,10 +198,7 @@ $switch-content-padding: map.merge(

@include when(checked) {
.#{$namespace}-switch__core {
border-color: var(
#{getCssVarName('switch-border-color')},
#{getCssVar('switch-on-color')}
);
border-color: var(#{getCssVarName('switch-border-color')}, #{getCssVar('switch-on-color')});
background-color: getCssVar('switch-on-color');

.#{$namespace}-switch__action {
Expand Down

0 comments on commit 6435b97

Please sign in to comment.