small fontSize rename, and 0-indexing arrays?
See original GitHub issueExample from Readme, regarding theme:
export default {
...
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fontSizes: [16, 20, 24, 32],
text: {
h1: {
fontSize: 3, // this is 24px, taken from `fontSize` above
},
p: {
fontSize: 1, // & this is 16px, taken from `fontSize` above
},
},
}
Might be an idea to rename some fields to:
export default {
...
space: [0, 4, 8, 16, 32, 64, 128, 256, 512], // in pixels, not em
fontSizes: [16, 20, 24, 32], // in pixels, not em
text: {
h1: {
fontSizeIndex: 2, // self-explaining, so no doc needed
},
p: {
fontSizeIndex: 0,
},
},
}
So that you can’t confuse the index with a size, and to 0-index it since people are familiar with that when dealing with arrays. The following example in the Readme seems to be using 0-indexing, so either case might just be a Readme remnant.
<Text
sx={{
color: 'primary',
padding: [1, 3], // [4px, 16px] from theme!
}}
>
Themed color!
</Text>
Alternatively also rename: padding → paddingIndex.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Arrays - Learn Ada (by AdaCore)
Array type declaration . Arrays in Ada are used to define contiguous collections of elements that can be selected by indexing. Here's...
Read more >Built-in Macro Functions - ImageJ
Returns the Unicode value of the character at the specified index in string. Index values can range from 0 to lengthOf(string). Use the ......
Read more >Array Indexing: 0-based or 1-based? | by Kim Fung - Medium
Zero-based array indexing is a way of numbering the items in an array such that the first item of it has an index...
Read more >Indexing and Selecting Data — pandas 0.15.2 documentation
A boolean array. See more at Selection by Label .iloc is primarily integer position based (from 0 to length-1 ...
Read more >ARRAY | CockroachDB Docs
The ARRAY data type stores one-dimensional, 1-indexed, homogeneous arrays of any non-array data types.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

0-index is correct. There’s no magic, it just checks theme[key][value]
Oh yeah the readme is probably picking the wrong index, we can fix that