diff --git a/client/patterns/card-layout/Details.tsx b/client/patterns/card-layout/Details.tsx index 7bbb934..b902871 100644 --- a/client/patterns/card-layout/Details.tsx +++ b/client/patterns/card-layout/Details.tsx @@ -22,23 +22,9 @@ const Details: React.FC<{}> = () => {
+
-
+
...
@@ -46,7 +32,24 @@ html={` ...
`} -css={``} +css={` +.container { + display: flex; + + /* Put a card in the next row when previous cards take all width */ + flex-wrap: wrap; + + margin-left: -8px; + margin-right: -8px; +} +.card { + /* There will be 4 cards per row */ + flex-basis: 25%; + + padding-left: 8px; + padding-right: 8px; +} +`} >
= () => {
+
...
-
+
- + -
- ... -
+
...
- +
...
`} -css={``} +css={` +.container { + display: flex; + flex-direction: column; +} +.main { + /* Take the remaining height */ + flex-grow: 1; + + /* Layout the left sidebar, main content and right sidebar */ + display: flex; + flex-direction: row; +} +.left { + width: 25%; +} +.middle { + /* Take the remaining width */ + flex-grow: 1; +} +.right { + width: 20%; +} +`} >
= () => {
+
-
+
... -
+
...
@@ -52,7 +41,24 @@ html={` ...
`} -css={``} +css={` +.container { + display: flex; +} +.column { + flex: 1; + /* Space between columns */ + margin: 0 8px; + + /* Layout each column */ + display: flex; + flex-direction: column; +} +.content { + /* Take available height */ + flex: 1; +} +`} >
= () => {
Try to scroll the main content!
+
-
`} -css={``} +css={` +.container { + display: flex; +} +.sidebar { + width: 30%; +} +.main { + /* Take the remaining width */ + flex: 1; + + /* Make it scrollable */ + overflow: auto; +} +`} >
= () => { -
+
-
25%
+
25%
-
+
...
`} -css={``} +css={` +.row { + display: flex; + + margin-left: -8px; + margin-right: -8px; +} +.cell { + padding-left: 8px; + padding-right: 8px; +} + +/* Cell with given width. Replace 25% with whatever you want */ +.cell.width-1/4 { + flex: 0 0 25%; +} +.cell.width-fill { + flex: 1; +} +`} >
= () => {
+
-
+
...
-
+
...
`} -css={``} +css={` +.container { + display: flex; +} +.half { + flex: 1; +} +`} >
= () => {
-
+
+
...
-
+
...
-
+
...
`} -css={``} +css={` +.container { + display: flex; + flex-direction: column; + height: 100%; +} +.header, +.footer { + flex-shrink: 0; +} +.main { + flex-grow: 1; +} +`} >
= () => { -
+
...
@@ -39,7 +35,13 @@ html={`
`} -css={``} +css={` +.header { + /* Stick to the top */ + position: sticky; + top: 0; +} +`} >
= () => {
-
+
+
...
@@ -44,7 +33,21 @@ html={` ...
`} -css={``} +css={` +.container { + height: 100%; + overflow: scroll; +} +.section { + /* Take full size */ + height: 100%; + width: 100%; + + /* Stick to the top */ + position: sticky; + top: 0; +} +`} >