Browse Source

add .is-disabled

pull/793/head
Thomas Willems 1 year ago
parent
commit
20ae02dd48
Failed to extract signature
  1. 11
      src/tailwind.config.js
  2. 10
      src/www/css/app.css
  3. 4
      src/www/index.html

11
src/tailwind.config.js

@ -5,4 +5,15 @@
module.exports = { module.exports = {
darkMode: 'media', darkMode: 'media',
content: ['./www/**/*.{html,js}'], content: ['./www/**/*.{html,js}'],
plugins: [
function addDisabledClass({ addUtilities }) {
const newUtilities = {
'.is-disabled': {
opacity: '0.25',
cursor: 'default',
},
};
addUtilities(newUtilities);
},
],
}; };

10
src/www/css/app.css

@ -1334,11 +1334,6 @@ video {
transition-duration: 150ms; transition-duration: 150ms;
} }
.disabled-link {
opacity: 0.25;
cursor: default;
}
.duration-200 { .duration-200 {
transition-duration: 200ms; transition-duration: 200ms;
} }
@ -1355,6 +1350,11 @@ video {
transition-timing-function: cubic-bezier(0, 0, 0.2, 1); transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
} }
.is-disabled {
opacity: 0.25;
cursor: default;
}
.last\:border-b-0:last-child { .last\:border-b-0:last-child {
border-bottom-width: 0px; border-bottom-width: 0px;
} }

4
src/www/index.html

@ -218,7 +218,7 @@
class="align-middle bg-gray-100 dark:bg-neutral-600 dark:text-neutral-300 p-2 rounded transition" class="align-middle bg-gray-100 dark:bg-neutral-600 dark:text-neutral-300 p-2 rounded transition"
:class="{ :class="{
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig, 'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
'opacity-25': !client.downloadableConfig 'is-disabled': !client.downloadableConfig
}" }"
:title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')"
@click="qrcode = `./api/wireguard/client/${client.id}/qrcode.svg`"> @click="qrcode = `./api/wireguard/client/${client.id}/qrcode.svg`">
@ -236,7 +236,7 @@
class="align-middle inline-block bg-gray-100 dark:bg-neutral-600 dark:text-neutral-300 p-2 rounded transition" class="align-middle inline-block bg-gray-100 dark:bg-neutral-600 dark:text-neutral-300 p-2 rounded transition"
:class="{ :class="{
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig, 'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
'disabled-link': !client.downloadableConfig 'is-disabled': !client.downloadableConfig
}" }"
:title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')"
@click="if(!client.downloadableConfig) { $event.preventDefault(); }"> @click="if(!client.downloadableConfig) { $event.preventDefault(); }">

Loading…
Cancel
Save