Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Make a Tailwind utility for inset shadow and replace manually defined…
Browse files Browse the repository at this point in the history
… styles
  • Loading branch information
dhruvkb committed Nov 30, 2021
1 parent 26688c4 commit 38528d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
6 changes: 1 addition & 5 deletions src/components/AudioTrack/Waveform.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
ref="el"
class="waveform relative bg-dark-charcoal-06 border-1.5 border-tx focus:border-pink focus:outline-none overflow-hidden"
class="waveform relative bg-dark-charcoal-06 border-1.5 border-tx focus:border-pink focus:outline-none focus:shadow-ring overflow-hidden"
:style="{ '--unusable-height': `${Math.floor((1 - usableFrac) * 100)}%` }"
tabIndex="0"
role="slider"
Expand Down Expand Up @@ -453,10 +453,6 @@ export default {
left: var(--seek-time-left);
}
.waveform:focus {
box-shadow: 0 0 0 1px inset white;
}
.waveform:focus-visible .focus-indicator {
display: flex;
}
Expand Down
8 changes: 1 addition & 7 deletions src/components/Header/SearchBar/SearchButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<VIconButton
v-bind="$attrs"
size="search"
class="search-button hover:text-white group-hover:text-white hover:bg-pink group-hover:bg-pink p-0.5px ps-1.5px focus:p-0 border border-s-0 focus:border-1.5 border-dark-charcoal-20 hover:border-pink group-hover:border-pink rounded-e-sm"
class="search-button hover:text-white group-hover:text-white hover:bg-pink group-hover:bg-pink p-0.5px ps-1.5px focus:p-0 border border-s-0 focus:border-1.5 border-dark-charcoal-20 hover:border-pink group-hover:border-pink rounded-e-sm active:shadow-ring"
:icon-props="{ iconPath: searchIcon }"
:aria-label="$t('search.search')"
v-on="$listeners"
Expand All @@ -23,9 +23,3 @@ export default {
},
}
</script>

<style scoped>
.search-button:active {
box-shadow: 0 0 0 1px inset white;
}
</style>
9 changes: 1 addition & 8 deletions src/components/VIconButton/VIconButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<button
class="icon-button flex items-center justify-center border-1.5 focus:border-pink focus:outline-none"
class="icon-button flex items-center justify-center border-1.5 focus:border-pink focus:outline-none focus:shadow-ring active:shadow-ring"
:class="[...buttonSizeClasses]"
:type="type"
v-on="$listeners"
Expand Down Expand Up @@ -67,10 +67,3 @@ export default {
},
}
</script>
<style scoped>
.icon-button:focus,
.icon-button:active {
box-shadow: 0 0 0 1px inset white;
}
</style>
4 changes: 4 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ module.exports = {
scale: {
'-100': '-1',
},
boxShadow: {
ring: 'inset 0 0 0 1px white',
},
},
},
variants: {
Expand All @@ -191,6 +194,7 @@ module.exports = {
ringWidth: ['focus-visible'],
borderWidth: ['focus', 'focus-within'],
padding: ['focus', 'focus-within'],
boxShadow: ['focus', 'active'],
},
},
plugins: [require('tailwindcss-rtl')],
Expand Down

0 comments on commit 38528d6

Please sign in to comment.