![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
vue-focus-visible
Advanced tools
✨ Automagically manage the visibility of :focus states in your app, showing them when a user uses your app with a keyboard/screen reader/etc. and hiding it when the user is only using the mouse.
✨ Automagically manage the visibility of :focus states in your app — by recreating the :focus-visible pseudo-selector behaviour.
Supports Vue 3.x out of the box 🎉
Do you know that problem when you have custom :focus
styles, but they're also getting applied on click 😒? Enough of that! Just install and include this plugin and you'll have a new, native HTML attribute v-focus-visible
which you can select via CSS. Examples are below.
Use this polyfill if you want to use the native :focus-visible
css pseudo-selector in all browsers, since Browser Support on it is currently very bad.
First install the package as a dependency of your project.
npm i vue-focus-visible
In your main.js
file, add the plugin like this:
// main.js
import Vue from 'vue'
// ...
import FocusVisible from 'vue-focus-visible'
Vue.use(FocusVisible)
// ...
Then include it into your application, the best place may be src/App.vue
:
<!-- src/App.vue -->
<template>
<div id="app" v-focus-visible>
...
Your App in here
...
</div>
</template>
<style>
/*
This package does not modify any of your stylings by default.
It adds a `v-focus-visible` HTML attribute (which will be either `"true"` or `"false"`).
You can simply select it and style the focus.
*/
:focus {
outline: none!important;
}
[v-focus-visible=true] :focus {
box-shadow: 0 0 0 2px #0498FB!important;
}
</style>
By default (on app load), the value of the v-focus-visible
is always true
. You can customize that.
// main.js
import FocusVisible from 'vue-focus-visible'
Vue.use(FocusVisible, {
defaultValue: true|false
})
option | type | default | description |
---|---|---|---|
defaultValue | boolean | true | Whether the focus should be visible or not on app-load. |
You can set the visibility state of the focus manually, with the global method $setFocusVisible(boolean)
.
Please note, that the next time the plugin changes the visibility, it will override your custom value.
Usage:
export default {
methods: {
foo() {
this.$setFocusVisible(false)
}
}
}
or
<template>
<button @click="$setFocusVisible(true)">My button</button>
</template>
Normally you don't have to deal with this, but if you want to make any contributions, just clone and download this repo,
@vue/cli-service
globally on your machinecd
into it the cloned reponpm i
to install everything and thennpm start
to start the development server with hot-reloadnpm run build
to compile and minify for production (will build everything in the dist
folder).Just hit me via a GitHub Issue.
If you want to, just fork this repo and create a PR if you like to add/improve something!
Also special thanks to filoxo for creating a similar solution, but it didn't quite fit to what I needed.
FAQs
✨ Automagically manage the visibility of :focus states in your app, showing them when a user uses your app with a keyboard/screen reader/etc. and hiding it when the user is only using the mouse.
The npm package vue-focus-visible receives a total of 56 weekly downloads. As such, vue-focus-visible popularity was classified as not popular.
We found that vue-focus-visible demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.