Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document speak-as CSS property. #37706

Merged
merged 35 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
05f540e
Document `speak-as` CSS property.
younisdev Jan 18, 2025
c803264
Add redirect for `speak-as` property
younisdev Jan 18, 2025
757aadd
Clarifying that `speak-as` is a descriptor at the title section.
younisdev Jan 18, 2025
0957b5f
fix indentation
younisdev Jan 18, 2025
a0c5fe1
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
ee1f4e0
add a space
younisdev Jan 18, 2025
828b622
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
7aada5b
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
c52b788
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
37c8bae
add a space
younisdev Jan 18, 2025
a8df1f6
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
72419ab
Add browser compat placeholder
younisdev Jan 18, 2025
88d3703
Fixed redirect mistake.
younisdev Jan 18, 2025
a5436ee
Update files/en-us/web/css/speak-as/index.md
younisdev Jan 18, 2025
eea54fe
Remove unnecessary `speak--as` redirect.
younisdev Jan 18, 2025
70de481
Merge branch 'main' into update1
younisdev Jan 20, 2025
e6878c6
add multiple speak-as value syntax
younisdev Feb 19, 2025
dc4733d
fix a typo
younisdev Feb 19, 2025
02b747d
Update files/en-us/web/css/speak-as/index.md
younisdev Feb 19, 2025
5fffcca
Update files/en-us/web/css/speak-as/index.md
younisdev Feb 19, 2025
1d14b87
fix title
younisdev Feb 19, 2025
a97741e
add 3 changes
younisdev Feb 19, 2025
448e4c6
Update files/en-us/web/css/speak-as/index.md
younisdev Feb 19, 2025
9fe92ba
Fix prettier issue
younisdev Feb 21, 2025
b71ed0e
Update index.md
younisdev Feb 21, 2025
e075acd
Merge branch 'main' into update1
Josh-Cena Feb 25, 2025
4ce32a9
Use the right line endings
Josh-Cena Feb 25, 2025
f4c08ce
Apply introduction review changes.
younisdev Feb 25, 2025
6a44e0f
Apply Values review changes.
younisdev Feb 25, 2025
1e4bdb1
Apply note section review changes.
younisdev Feb 25, 2025
d3c095d
Apply examples section review changes.
younisdev Feb 25, 2025
1f2b334
Apply examples-css section review changes.
younisdev Feb 25, 2025
5206dba
Apply See also section review changes.
younisdev Feb 25, 2025
afc097a
Merge branch 'mdn:main' into update1
younisdev Feb 25, 2025
28bf820
Update files/en-us/web/css/speak-as/index.md
estelle Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12106,7 +12106,6 @@
/en-US/docs/Web/CSS/sign() /en-US/docs/Web/CSS/sign
/en-US/docs/Web/CSS/sign_function /en-US/docs/Web/CSS/sign
/en-US/docs/Web/CSS/single-transition-timing-function /en-US/docs/Web/CSS/easing-function
/en-US/docs/Web/CSS/speak-as /en-US/docs/Web/CSS/@counter-style/speak-as
/en-US/docs/Web/CSS/static /en-US/docs/Web/CSS/position
/en-US/docs/Web/CSS/suffix /en-US/docs/Web/CSS/@counter-style/suffix
/en-US/docs/Web/CSS/symbols() /en-US/docs/Web/CSS/symbols
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/@counter-style/speak-as/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: speak-as
title: speak-as (@counter-style)
slug: Web/CSS/@counter-style/speak-as
page-type: css-at-rule-descriptor
browser-compat: css.at-rules.counter-style.speak-as
Expand Down
83 changes: 83 additions & 0 deletions files/en-us/web/css/speak-as/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: speak-as
slug: Web/CSS/speak-as
page-type: css-property
browser-compat: css.properties.speak-as
---

{{CSSRef}}

The **`speak-as`** property is a part of [CSS](/en-US/docs/Web/CSS) Speech, which is used to manipulate how the [HTML](/en-US/docs/Web/HTML) content is spoken by assistive technologies, especially screen readers. More specifically, **`speak-as`** specifies how elements (any HTML element if not paired with [@counter-style](/en-US/docs/Web/CSS/@counter-style/speak-as)) and/or their content are spoken.

## Syntax

```css
speak-as: normal;
speak-as: spell-out;
speak-as: literal-punctuation;
speak-as: digits;
speak-as: no-punctuation;
```

### Values

- `normal`
- : Default value, which uses normal pronunciation rules, but punctuation is replaced by pauses. For example, instead of "Hello, world!" it would be pronounced as "Hello (pause) world (pause)"
- `spell-out`
- : Content is spelled out letter by letter. For example, "role" would be pronounced "r" "o" "l" "e".
- `literal-punctuation`
- : Punctuation marks are spelled out literally. For example, instead of "Hello, world!" it would be pronounced as "Hello comma world exclamation mark.".
- `digits`
- : Numbers are pronounced as individual digits. For example, 31 is pronounced as "three one".
- `no-punctuation`
- : The content is pronounced normally without any punctuation. For example, instead of "Hello, world!" it would be pronounced as "Hello world".

> [!NOTE]
> The support of `speak-as` property is very limited or inconsistently implemented across different assistive technologies (such as screen readers or speech synthesizers). It's often recommended not to fully rely on it solely to deliver your critical information, to ensure it remains user friendly and accessible to a wide audience.

## Example

### HTML

```HTML
<p class="normal">Hello, world!</p>
<p class="spell-out">Hello, world!</p>
<p class="literal-punctuation">Hello, world!</p>
<p class="no-punctuation">Hello, world!</p>
<p class="digits">25</p>
```

### CSS

```CSS
.normal {
speak-as: normal;
}

.spell-out {
speak-as: spell-out;
}

.literal-punctuation {
speak-as: literal-punctuation;
}

.no-punctuation {
speak-as: no-punctuation;
}

.digits {
speak-as: digits;
}
```
Copy link
Contributor

@skyclouds2001 skyclouds2001 Feb 14, 2025

Choose a reason for hiding this comment

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

similar to the comment under syntax section

#37706 (comment)


## Browser compatibility

{{Compat}}

## See also

- How to use [speak-as descriptor](/en-US/docs/Web/CSS/@counter-style/speak-as) as descriptor for {{cssxref("@counter-style")}} which is part of the `@counter-style` at-rule.
- More information on {{cssxref("@counter-style")}}.
- [CSS counter styles](/en-US/docs/Web/CSS/CSS_counter_styles)
- [CSS lists and counters](/en-US/docs/Web/CSS/CSS_lists)
Loading