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:
parent
1be2edf1a3
commit
531facc2a1
@ -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)([], {
|
||||
|
@ -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.
Loading…
Reference in New Issue
Block a user