Skip to content

Commit decfa3b

Browse files
authored
Merge pull request #48 from BrianHicks/patch-1
Add a FAQ
2 parents 749de61 + c1e6e21 commit decfa3b

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

FAQ.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Frequently Asked Questions
2+
3+
## How do I use `z-index`?
4+
5+
The z-index property isn't currently supported. We're trying to figure out the best API for layered elements, and you can help! Please submit your use cases to [issue #46](https://github.com/mdgriffith/style-elements/issues/46) so we can find the best solution for everyone.
6+
7+
While you're waiting, you can use the [`Style.prop` function](http://package.elm-lang.org/packages/mdgriffith/style-elements/latest/Style#prop) to get what you need:
8+
9+
```elm
10+
zIndex : Int -> Property class variation
11+
zIndex n =
12+
prop "z-index" (toString n)
13+
```
14+
15+
## How do I set margins?
16+
17+
Supporting both margins and padding make consistent layouts difficult, so style-elements only uses padding.
18+
19+
If you need spacing between children in a layout, use [`Element.Attributes.spacing`](http://package.elm-lang.org/packages/mdgriffith/style-elements/latest/Element-Attributes#spacing).
20+
21+
To set more space around a single element, wrap the element in a spacer a set padding. This is more explicit and you can predict exactly how your element will be laid out.

0 commit comments

Comments
 (0)