forked from components-ai/css.gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunsupported.tsx
More file actions
99 lines (96 loc) · 2.84 KB
/
unsupported.tsx
File metadata and controls
99 lines (96 loc) · 2.84 KB
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
import {
allProperties,
mdnProperties,
unsupportedProperties,
} from '@compai/css-gui'
import { FirstParagraph } from '../components/FirstParagraph'
import { Container } from '../components/Container'
export default function UnsupportedProperties() {
const allPropertiesCount = allProperties.length
const unsupportedPropertiesCount = unsupportedProperties.length
const implementedPropertiesCount =
allPropertiesCount - unsupportedPropertiesCount
const percentageComplete = Math.round(
(implementedPropertiesCount / allPropertiesCount) * 100
)
return (
<Container>
<div sx={{ pt: [5, 6] }}>
<h1>Unsupported properties</h1>
<FirstParagraph>
<p>
CSS GUI is a work in progress, below is an up to date listing of
properties that haven't been implemented yet.
</p>
</FirstParagraph>
<label
htmlFor="progress"
sx={{
fontSize: 3,
}}
>
<span>
So far, we've implemented{' '}
<b>
{implementedPropertiesCount} out of {allPropertiesCount}
</b>{' '}
properties ({percentageComplete}%).
</span>
<progress
id="progress"
max="100"
value={percentageComplete}
sx={{
mt: 2,
width: '100%',
WebKitAppearance: 'none',
appearance: 'none',
border: 0,
height: '48px',
'&::-webkit-progress-value': {
background: '#6465ff',
},
'&::-moz-progress-bar': {
background: '#6465ff',
}
}}
>
{percentageComplete}%
</progress>
</label>
<div sx={{ display: 'flex', justifyContent: 'space-between' }}>
<span>0</span>
<span>427</span>
</div>
<h2 sx={{ mt: 5, mb: 4 }}>
The following properties are on our TODO list
</h2>
<ul sx={{ pl: 3, columnCount: 3 }}>
{unsupportedProperties.map(({ property, url }) => {
const hasMDN = hasMDNDocs(property)
const color = hasMDN ? 'text' : 'muted'
return (
<li sx={{ color }}>
{property}{' '}
<a sx={{ color }} href={url}>
W3C
</a>{' '}
{hasMDN && (
<a
sx={{ color }}
href={`https://developer.mozilla.org/en-US/docs/Web/CSS/${property}`}
>
MDN
</a>
)}
</li>
)
})}
</ul>
</div>
</Container>
)
}
function hasMDNDocs(property: string) {
return mdnProperties.includes(property)
}