Skip to content

Allowing for modes on a11y #9188

Closed
@plutoniumm

Description

@plutoniumm

Describe the problem

When building applications, I often don't need A11y since I know it will just be me on the other end of the app. There are times when I know that A11y will be THE main feature. Due to this distinct range, I can see why Svelte's A11y is slightly aggressive but not by a lot.

So it'll be nice to have modes enabled in the (vite|svelte).config.js file where the default is current settings, and otherwise, I can select the sensitivity of A11y

Describe the proposed solution

// vite.config.js 
const config = defineConfig( {
	plugins: [ svelte( {
		a11y: 'off' // or 'strict' or 'default'
	} ) ],
} );

So here when off, it would turn off ALL a11y features, including img alt, whereas when strict may in some way ask for aria-x per component. I can see that is very non-trivial to decide at what SCALE to implement A11y since people may make a component for a part of a card which may not really need an A11y, but I think we can resolve that with some community input

Alternatives considered

I did look for alternatives, as extensions as such, but there don't really exist lightweight ones/ ones with sensible defaults. Additionally, this is going to be a svelte compiler modifying behaviour and will modify only a small part of the system namely the warnings generated by the compiler

Currently I resort to using a combination of eslint and/or turning off warnings as needed

Importance

would make my life easier

PS: I'm willing to contribute/help out in anyway i can

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions