1
1
mirror of https://github.com/c8r/x0.git synced 2024-08-16 17:00:24 +03:00

Adjust Library grid styles

This commit is contained in:
Brent Jackson 2018-06-23 13:04:20 -04:00
parent 1be2edf1a3
commit 531facc2a1
3 changed files with 12 additions and 20 deletions

View File

@ -1,24 +1,17 @@
import React from 'react'
import { Link } from 'react-router-dom'
import styled from 'styled-components'
import { style, borderColor } from 'styled-system'
import {
style,
gridGap,
gridAutoRows,
borderColor
} from 'styled-system'
const gridWidth = style({
prop: 'width',
cssProperty: 'gridTemplateColumns',
getter: n => `repeat(auto-fit, minmax(${n}, 1fr))`
})
const gridGap = style({
prop: 'gap',
cssProperty: 'gridGap',
numberToPx: true
})
const gridHeight = style({
prop: 'height',
cssProperty: 'gridAutoRows',
numberToPx: true
getter: n => `repeat(auto-fit, minmax(${n}px, 1fr))`
})
const Grid = styled.div([], {
@ -26,12 +19,12 @@ const Grid = styled.div([], {
},
gridWidth,
gridGap,
gridHeight
gridAutoRows
)
Grid.defaultProps = {
width: '256px',
height: 192
width: 256,
gridAutoRows: 192
}
const Card = styled(Link)([], {

View File

@ -66,9 +66,8 @@ Generated by [AVA](https://ava.li).
> Snapshot 1
<div
className="sc-bbmXgH hCNAIb"
height={192}
width="256px"
className="sc-bbmXgH kzGbIY"
width={256}
>
<a
borderColor="gray"

Binary file not shown.