orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
4.08k stars 416 forks source link

[Feat]: Buttons do not have a discernible name #726

Open sovetski opened 3 months ago

sovetski commented 3 months ago

Description

If you check with Lighthouse, you will see this error: Links do not have a discernible name

Proposed solution

As suggested here: https://dequeuniversity.com/rules/axe/4.1/link-name

<a href="taxhike.html" aria-label="Read more about Seminole tax hike">[Read more...]</a>

Additional details

No response

alxndr-w commented 2 months ago

https://cookieconsent.orestbida.com/reference/configuration-reference.html#translation-consentmodal

translations: {
    'en': {
        consentModal: {
            label: 'Cookie Consent',
            title: 'We use cookies!',
            description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
            acceptAllBtn: 'Accept all',
            acceptNecessaryBtn: 'Accept necessary',
            showPreferencesBtn: 'Manage individual preferences',
            footer: `
                <a href="#path-to-impressum.html" target="_blank">Impressum</a>
                <a href="#path-to-privacy-policy.html" target="_blank">Privacy Policy</a>
            `
        }
    }
}

The Footer can be customized like you want it. However, the docs could follow best practice as well.

sovetski commented 2 months ago

https://cookieconsent.orestbida.com/reference/configuration-reference.html#translation-consentmodal


translations: {

    'en': {

        consentModal: {

            label: 'Cookie Consent',

            title: 'We use cookies!',

            description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',

            acceptAllBtn: 'Accept all',

            acceptNecessaryBtn: 'Accept necessary',

            showPreferencesBtn: 'Manage individual preferences',

            footer: `

                <a href="#path-to-impressum.html" target="_blank">Impressum</a>

                <a href="#path-to-privacy-policy.html" target="_blank">Privacy Policy</a>

            `

        }

    }

}

The Footer can be customized like you want it. However, the docs could follow best practice as well.

Footer yes but not buttons like "Manage individual preferences" 😕

alxndr-w commented 2 months ago

Ok, good point - I think you need to reflect this for the issue's title. I read "Links", not "Buttons" (or at least "Anchors") and my first thoughts have been "Hyperlinks, Imprint, Privacy Policy".