Skip to content

amp-consent uiConfig and captions documentation#26722

Merged
micajuine-ho merged 2 commits intoampproject:masterfrom
micajuine-ho:consent_doc
Feb 11, 2020
Merged

amp-consent uiConfig and captions documentation#26722
micajuine-ho merged 2 commits intoampproject:masterfrom
micajuine-ho:consent_doc

Conversation

@micajuine-ho
Copy link
Copy Markdown
Contributor

@micajuine-ho micajuine-ho commented Feb 10, 2020

For #26432

Copy link
Copy Markdown
Contributor

@zhouyx zhouyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment, but not blocking. Looks good!


#### captions

`captions` provides accessibility features for screen reader users for `<amp-consent>`. `captions` is an optional JSON an object that can contain the keys `consentPromptCaption` and `buttonActionCaption` which are both strings and will have default values 'User Consent Prompt' and 'Focus Prompt'. When an consent prompt in an iframe is loaded, the screen reader will read the `consentPromptCaption` and then the `buttonActionCaption`. The `consentPromptCaption` should act as a title for the consent prompt, while the `buttonActionCaption` should inform the user that they can interact with the iframe.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Do you want to put an example JSON instead?

"captions": {
  "consentPromptCaption": "This is an example user consent prompt",
  "buttonActionCaption": "This is an example message"
}

Might also worth mentioning that default value is provided, but one can customize or localize the message to fit their own use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants