~alcinnz/rhapsode

ref: 2adc7fb2e4778f57c1af1406229639f485961470 rhapsode/src/DefaultCSS.hs -rw-r--r-- 4.5 KiB
2adc7fb2 — Adrian Cochrane Parse content & counter properties, cleanup property handling. 4 years ago
                                                                                
f592768d Adrian Cochrane
2adc7fb2 Adrian Cochrane
f592768d Adrian Cochrane
4d356592 Adrian Cochrane
df290308 Adrian Cochrane
4d356592 Adrian Cochrane
df290308 Adrian Cochrane
53b9d822 Adrian Cochrane
4d356592 Adrian Cochrane
f592768d Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
4d356592 Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
4d356592 Adrian Cochrane
f592768d Adrian Cochrane
4d356592 Adrian Cochrane
f592768d Adrian Cochrane
5b9b03db Adrian Cochrane
f592768d Adrian Cochrane
df290308 Adrian Cochrane
f592768d Adrian Cochrane
5b9b03db Adrian Cochrane
2adc7fb2 Adrian Cochrane
4d356592 Adrian Cochrane
f592768d Adrian Cochrane
df290308 Adrian Cochrane
f592768d Adrian Cochrane
2adc7fb2 Adrian Cochrane
53b9d822 Adrian Cochrane
2adc7fb2 Adrian Cochrane
53b9d822 Adrian Cochrane
2adc7fb2 Adrian Cochrane
53b9d822 Adrian Cochrane
2adc7fb2 Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
5b9b03db Adrian Cochrane
f592768d Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
53b9d822 Adrian Cochrane
f592768d Adrian Cochrane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module DefaultCSS(userAgentCSS) where

userAgentCSS = unlines [
  "head, link, meta, style, script, title, base {speak: never}",
  "datalist, template {speak: never}",
  "html {speak-as: normal no-punctuation}",
  "",
  "/** Forms **/",
  "/* Hide buttons that don't do anything */",
  "button[type=button] {speak: never}",
  "button[formaction] {speak: always}",
  "",
  "button::before, input[type=button]::before, input[type=submit]::before {",
  "        content: 'Button';",
  "        voice-pitch: high;",
  "}",
  "select::before, textarea::before, input::before {content: 'Input'; voice-pitch: high}",
  "output::before {content: 'Output'; voice-pitch: high}",
  "text-area, button, select, input, output {voice-pitch: low}",
  "input, output {content: attr(value)}",
  "text-area {speak-as: literal-punctuation}",
  "",
  "option:not([checked]) {speak: never}",
  "select[multiple] option {cue-before: url(bulletpoint.wav)}",
  "",
  "/* Forms themselves require a label in order to support navigation */",
  "form::before {content: 'Form'}",
  "form[action]::before {content: attr(action)}",
  "form[alt]::before {content: attr(alt)}",
  "form[title]::before {content: attr(title)}",
  "",
  "/** Tables **/",
  "table::before {content: 'Table'; voice-volume: x-soft}",
  "tr {cue-before: url(bulletpoint.wav)}",
  "td, th {cue-before: url(bulletpoint.wav) -1db}",
  "th::th /* Rhapsode-specific, selects inlined table headers */ {speak: never;}",
  "table caption {voice-volume: soft}",
  "",
  "/** Sectioning **/",
  "footer, header {voice-volume: soft}",
  "nav {speak: never} /* Expose the links for navigation, but not narration */",
  "h1, h2, h3, h4, h5, h6, legend, th, summary, dt {voice-stress: strong}",
  "h1 {pause: x-strong; voice-rate: x-slow}",
  "h2 {pause: strong; voice-rate: slow}",
  "h3, th, summary, legend, dt {pause: medium; voice-rate: medium}",
  "h4 {pause: weak; voice-rate: fast}",
  "h5, h6 {pause: x-weak; voice-rate: fast}",
  "h6 {voice-pitch: high}",
  "",
  "/** Text **/",
  "hr {pause: x-strong}",
  "p, pre, samp, blockquote {pause: strong}",
  "pre, address, samp {speak-as: literal-punctuation}",
  "pre, samp, code {voice: neutral 2}",
  "a[href], :link {cue-before: url(link.wav); voice-pitch: low}",
  ":link:visited {cue-before: url(link.wav) -1db}",
  "",
  "b, strong {voice-rate: slow}",
  "i, em {voice-stress: strong}",
  "br {pause: medium}",
  "code {speak-as: literal-punctuation}",
  "s, del {voice-volume: x-soft}",
  "u, ins {voice-volume: loud}",
  "",
  "/** lists **/",
  "li, dt, dd {cue-before: url(bulletpoint.wav); pause: strong}",
  "li li, dd dt, dd dd {cue-before: url(bulletpoint.wav) -1db}",
  "li li li, dd dd dt, dd dd dd {cue-before: url(bulletpoint.wav) -2db}",
  "li li li li, dd dd dd dt, dd dd dd dd {cue-before: url(bulletpoint.wav) -3db}",
  "li li li li li, dd dd dd dd dt, dd dd dd dd dd {",
  "       cue-before: url(bulletpoint.wav) -4db",
  "}",
  "li li li li li li, dd dd dd dd dd dt, dd dd dd dd dd dd {",
  "       cue-before: url(bulletpoint.wav) -5db",
  "}",
  "",
  "ol {counter-reset: -rhaps-ol1}",
  "ol ol {counter-reset: -rhaps-ol2}",
  "ol ol ol {counter-reset: -rhaps-ol3}",
  "ol ol ol ol {counter-reset: -rhaps-ol4}",
  "ol ol ol ol ol {counter-reset: -rhaps-ol5}",
  "ol ol ol ol ol ol {counter-reset: -rhaps-ol6}",
  "ol li::before {",
  "counter-increment: -rhaps-ol1;",
  "content: counter(-rhaps-ol1)",
  "}",
  "ol ol li::before {",
  "counter-increment: -rhaps-ol2;",
  "content: counters(-rhaps-ol1, -rhaps-ol2)",
  "}",
  "ol ol ol li::before {",
  "counter-increment: -rhaps-ol3;",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3)",
  "}",
  "ol ol ol ol li::before {",
  "counter-increment: -rhaps-ol4;",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4)",
  "}",
  "ol ol ol ol ol li::before {",
  "counter-increment: -rhaps-ol5;",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5)",
  "}",
  "ol ol ol ol ol ol li::before {",
  "counter-increment: -rhaps-ol6;",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5, -rhaps-ol6)",
  "}",
  "",
  "",
  "/** HTML6 **/",
  "abbr[title]::after {content: attr(title); voice-volume: x-soft}",
  "abbr {speak-as: spell-out}",
  "",
  "q, blockquote {voice-family: female 2}",
  "cite {voice-stress: reduce}",
  "dialog:not([open]) {speak: never}",
  "kbd {speak-as: spell-out}",
  "progress {content: attr(value) 'of' attr(max)}",
  "sub {voice-rate: x-fast}",
  "sup {voice-rate: fast}",
  "var {voice-rate: slow}"
  ]