Skip to content

Commit

Permalink
refact(mixins): move scrollbar mixin to kotti-style
Browse files Browse the repository at this point in the history
used by more than just the kotti-fields now
  • Loading branch information
carsoli committed Jul 25, 2022
1 parent 72482f8 commit e285e52
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default defineComponent<{
</script>

<style lang="scss" scoped>
@import '../../kotti-field/mixins';
@import '../../kotti-style/_mixins.scss';
.kt-comment-inline-edit {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
@import '../../kotti-field/mixins.scss';
@import '../../kotti-style/_mixins.scss';
.kt-field-select__options {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ export default defineComponent<KottiFieldTextArea.PropsInternal>({
})
</script>

<style lang="scss">
@import '../kotti-field/mixins';
<style lang="scss" scoped>
@import '../kotti-style/_mixins.scss';
@import '../kotti-field/mixins.scss';
.kt-field-text-area {
$vertical-padding: 0.6em;
Expand Down
27 changes: 0 additions & 27 deletions packages/kotti-ui/source/kotti-field/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -391,34 +391,7 @@
}
}

@mixin prettify-scrollbar {
&::-webkit-scrollbar {
opacity: 0;
}

scrollbar-width: thin;
scrollbar-color: var(--ui-background) var(--ui-background);

&:active,
&:hover {
scrollbar-color: var(--ui-03) var(--ui-background);
transition: scrollbar-color var(--transition-medium) ease-out;

&::-webkit-scrollbar {
width: 5px;
height: 5px;
opacity: 1;
transition: opacity var(--transition-medium) ease-out;
}

&::-webkit-scrollbar-thumb {
cursor: all-scroll;

background-color: var(--ui-03);
border-radius: var(--field-border-radius);
}
}
}

@mixin sizes {
$fontSizes: (
Expand Down
28 changes: 28 additions & 0 deletions packages/kotti-ui/source/kotti-style/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@mixin prettify-scrollbar {
&::-webkit-scrollbar {
opacity: 0;
}

scrollbar-width: thin;
scrollbar-color: var(--ui-background) var(--ui-background);

&:active,
&:hover {
scrollbar-color: var(--ui-03) var(--ui-background);
transition: scrollbar-color var(--transition-medium) ease-out;

&::-webkit-scrollbar {
width: 5px;
height: 5px;
opacity: 1;
transition: opacity var(--transition-medium) ease-out;
}

&::-webkit-scrollbar-thumb {
cursor: all-scroll;

background-color: var(--ui-03);
border-radius: var(--field-border-radius);
}
}
}
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Utility classes
@import 'utilities';
@import 'media';
@import 'mixins';

// Layout
@import 'layout';
Expand Down

0 comments on commit e285e52

Please sign in to comment.