diff --git a/components/grid/__tests__/__snapshots__/demo.test.js.snap b/components/grid/__tests__/__snapshots__/demo.test.js.snap index 9c071ced42..e065c2dd0a 100644 --- a/components/grid/__tests__/__snapshots__/demo.test.js.snap +++ b/components/grid/__tests__/__snapshots__/demo.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./components/grid/demo/basic.md correctly 1`] = ` -
+Array [
@@ -10,7 +10,7 @@ exports[`renders ./components/grid/demo/basic.md correctly 1`] = ` > col
-
+ ,
@@ -24,7 +24,7 @@ exports[`renders ./components/grid/demo/basic.md correctly 1`] = ` > col-12
- + ,
@@ -43,7 +43,7 @@ exports[`renders ./components/grid/demo/basic.md correctly 1`] = ` > col-8
- + ,
@@ -67,15 +67,23 @@ exports[`renders ./components/grid/demo/basic.md correctly 1`] = ` > col-6
- - + , +] `; exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` -
-

- sub-element align left -

+Array [ + ,
@@ -99,10 +107,18 @@ exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` > col-4
-
-

- sub-element align center -

+ , + ,
@@ -126,10 +142,18 @@ exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` > col-4
- -

- sub-element align right -

+ , + ,
@@ -153,10 +177,18 @@ exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` > col-4
- -

- sub-element monospaced arrangement -

+ , + ,
@@ -180,10 +212,18 @@ exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` > col-4
- -

- sub-element align full -

+ , + ,
@@ -207,15 +247,23 @@ exports[`renders ./components/grid/demo/flex.md correctly 1`] = ` > col-4
- - + , +] `; exports[`renders ./components/grid/demo/flex-align.md correctly 1`] = ` -
-

- Align Top -

+Array [ + ,
@@ -255,10 +303,18 @@ exports[`renders ./components/grid/demo/flex-align.md correctly 1`] = ` col-4

-
-

- Align Center -

+ , + ,
@@ -298,10 +354,18 @@ exports[`renders ./components/grid/demo/flex-align.md correctly 1`] = ` col-4

- -

- Align Bottom -

+ , + ,
@@ -341,44 +405,50 @@ exports[`renders ./components/grid/demo/flex-align.md correctly 1`] = ` col-4

- - + , +] `; exports[`renders ./components/grid/demo/flex-order.md correctly 1`] = ` -
+
-
- 1 col-order-4 -
-
- 2 col-order-3 -
-
- 3 col-order-2 -
-
- 4 col-order-1 -
+ 1 col-order-4 +
+
+ 2 col-order-3 +
+
+ 3 col-order-2 +
+
+ 4 col-order-1
`; exports[`renders ./components/grid/demo/flex-stretch.md correctly 1`] = ` -
-

- Percentage columns -

+Array [ + ,
@@ -394,10 +464,18 @@ exports[`renders ./components/grid/demo/flex-stretch.md correctly 1`] = ` > 3 / 5
-
-

- Fill rest -

+
, + ,
@@ -413,10 +491,18 @@ exports[`renders ./components/grid/demo/flex-stretch.md correctly 1`] = ` > Fill Rest
- -

- Raw flex style -

+ , + ,
@@ -432,14 +518,23 @@ exports[`renders ./components/grid/demo/flex-stretch.md correctly 1`] = ` > 0 1 300px
- - + , +] `; exports[`renders ./components/grid/demo/gutter.md correctly 1`] = ` -
+Array [ + ,
col-6
@@ -459,7 +554,7 @@ exports[`renders ./components/grid/demo/gutter.md correctly 1`] = ` style="padding-left:8px;padding-right:8px" >
col-6
@@ -469,7 +564,7 @@ exports[`renders ./components/grid/demo/gutter.md correctly 1`] = ` style="padding-left:8px;padding-right:8px" >
col-6
@@ -479,62 +574,169 @@ exports[`renders ./components/grid/demo/gutter.md correctly 1`] = ` style="padding-left:8px;padding-right:8px" >
col-6
-
+ , + ,
col-6
col-6
col-6
col-6
-
- + , + , +
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
+
+ col-6 +
+
+
, +] `; exports[`renders ./components/grid/demo/offset.md correctly 1`] = ` -
+Array [
@@ -548,7 +750,7 @@ exports[`renders ./components/grid/demo/offset.md correctly 1`] = ` > col-8
-
+ ,
@@ -562,7 +764,7 @@ exports[`renders ./components/grid/demo/offset.md correctly 1`] = ` > col-6 col-offset-6
- + ,
@@ -571,310 +773,306 @@ exports[`renders ./components/grid/demo/offset.md correctly 1`] = ` > col-12 col-offset-6
- - + , +] `; exports[`renders ./components/grid/demo/playground.md correctly 1`] = ` -
-
+ Horizontal Gutter (px): + , +
- - Horizontal Gutter (px): -
+
+
-
-
-
+ + + +
+
+
+ - - - - - - -
-
-
+ - - 8 - - - 16 - - - 24 - - - 32 - - - 40 - - - 48 - -
+ 16 + + + 24 + + + 32 + + + 40 + + + 48 +
- - Vertical Gutter (px): - +
, + + Vertical Gutter (px): + , +
+
+
-
-
-
+ + + +
+
+
+ - - - - - - -
-
-
+ - - 8 - - - 16 - - - 24 - - - 32 - - - 40 - - - 48 - -
+ 16 + + + 24 + + + 32 + + + 40 + + + 48 +
- - Column Count: - +
, + + Column Count: + , +
+
+
-
-
-
+ + + +
+
+
+ - - - - - - -
-
-
+ - - 2 - - - 3 - - - 4 - - - 6 - - - 8 - - - 12 - -
+ 3 + + + 4 + + + 6 + + + 8 + + + 12 +
-
+
,
-
+
,
-
+
,
     <Row gutter={[16, 16]}>
   <Col span={6} />
@@ -956,7 +1154,7 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
   <Col span={6} />
   <Col span={6} />
 </Row>
-  
+ ,
     <Row gutter={[16, 16]}>
   <Col span={6} />
@@ -964,8 +1162,8 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
   <Col span={6} />
   <Col span={6} />
 </Row>
-  
-
+ , +] `; exports[`renders ./components/grid/demo/responsive.md correctly 1`] = ` @@ -1013,20 +1211,18 @@ exports[`renders ./components/grid/demo/responsive-more.md correctly 1`] = ` `; exports[`renders ./components/grid/demo/sort.md correctly 1`] = ` -
+
-
- col-18 col-push-6 -
-
- col-6 col-pull-18 -
+ col-18 col-push-6 +
+
+ col-6 col-pull-18
`; diff --git a/components/grid/demo/basic.md b/components/grid/demo/basic.md index be93a73f0c..5b2c3382d4 100644 --- a/components/grid/demo/basic.md +++ b/components/grid/demo/basic.md @@ -21,7 +21,7 @@ You can create a basic grid system by using a single set of `Row` and `Col` grid import { Row, Col } from 'antd'; ReactDOM.render( -
+ <> col @@ -40,7 +40,7 @@ ReactDOM.render( col-6 col-6 -
, + , mountNode, ); ``` diff --git a/components/grid/demo/flex-align.md b/components/grid/demo/flex-align.md index 3cbe05311c..92f24327cb 100644 --- a/components/grid/demo/flex-align.md +++ b/components/grid/demo/flex-align.md @@ -14,13 +14,15 @@ title: Child elements vertically aligned. ```jsx -import { Row, Col } from 'antd'; +import { Row, Col, Divider } from 'antd'; const DemoBox = props =>

{props.children}

; ReactDOM.render( -
-

Align Top

+ <> + + Align Top + col-4 @@ -36,7 +38,9 @@ ReactDOM.render( -

Align Center

+ + Align Center + col-4 @@ -52,7 +56,9 @@ ReactDOM.render( -

Align Bottom

+ + Align Bottom + col-4 @@ -67,7 +73,7 @@ ReactDOM.render( col-4 -
, + , mountNode, ); ``` diff --git a/components/grid/demo/flex-order.md b/components/grid/demo/flex-order.md index 9a32900892..ab6a985c93 100644 --- a/components/grid/demo/flex-order.md +++ b/components/grid/demo/flex-order.md @@ -17,22 +17,20 @@ To change the element sort by order. import { Row, Col } from 'antd'; ReactDOM.render( -
- - - 1 col-order-4 - - - 2 col-order-3 - - - 3 col-order-2 - - - 4 col-order-1 - - -
, + + + 1 col-order-4 + + + 2 col-order-3 + + + 3 col-order-2 + + + 4 col-order-1 + + , mountNode, ); ``` diff --git a/components/grid/demo/flex-stretch.md b/components/grid/demo/flex-stretch.md index 824b019a59..a543157282 100644 --- a/components/grid/demo/flex-stretch.md +++ b/components/grid/demo/flex-stretch.md @@ -14,26 +14,32 @@ Col 提供 `flex` 属性以支持填充。 Col provides `flex` prop to support fill rest. ```jsx -import { Row, Col } from 'antd'; +import { Row, Col, Divider } from 'antd'; ReactDOM.render( -
-

Percentage columns

+ <> + + Percentage columns + 2 / 5 3 / 5 -

Fill rest

+ + Fill rest + 100px Fill Rest -

Raw flex style

+ + Raw flex style + 1 1 200px 0 1 300px -
, + , mountNode, ); ``` diff --git a/components/grid/demo/flex.md b/components/grid/demo/flex.md index 6638a1d0be..05b06d08c1 100644 --- a/components/grid/demo/flex.md +++ b/components/grid/demo/flex.md @@ -16,11 +16,13 @@ title: Child elements depending on the value of the `start`,`center`, `end`,`space-between`, `space-around`, which are defined in its parent node typesetting mode. ```jsx -import { Row, Col } from 'antd'; +import { Row, Col, Divider } from 'antd'; ReactDOM.render( -
-

sub-element align left

+ <> + + sub-element align left + col-4 col-4 @@ -28,7 +30,9 @@ ReactDOM.render( col-4 -

sub-element align center

+ + sub-element align center + col-4 col-4 @@ -36,7 +40,9 @@ ReactDOM.render( col-4 -

sub-element align right

+ + sub-element align right + col-4 col-4 @@ -44,7 +50,9 @@ ReactDOM.render( col-4 -

sub-element monospaced arrangement

+ + sub-element monospaced arrangement + col-4 col-4 @@ -52,14 +60,16 @@ ReactDOM.render( col-4 -

sub-element align full

+ + sub-element align full + col-4 col-4 col-4 col-4 -
, + , mountNode, ); ``` diff --git a/components/grid/demo/gutter.md b/components/grid/demo/gutter.md index 43746ac176..5e006a64a3 100644 --- a/components/grid/demo/gutter.md +++ b/components/grid/demo/gutter.md @@ -26,51 +26,84 @@ You can use a array to set vertical spacing, `[horizontal, vertical]` `[16, { xs > vertical gutter was supported after `3.24.0`. ```jsx -import { Row, Col } from 'antd'; +import { Row, Col, Divider } from 'antd'; + +const style = { background: '#0092ff', padding: '8px 0' }; ReactDOM.render( -
+ <> + + Horizontal + -
col-6
+
col-6
-
col-6
+
col-6
-
col-6
+
col-6
-
col-6
+
col-6
- + + Responsive + + -
col-6
+
col-6
-
col-6
+
col-6
-
col-6
+
col-6
-
col-6
+
col-6
-
, + + Vertical + + + +
col-6
+ + +
col-6
+ + +
col-6
+ + +
col-6
+ + +
col-6
+ + +
col-6
+ + +
col-6
+ + +
col-6
+ +
+ , mountNode, ); ``` ```css -.gutter-example .ant-row > div { - background: transparent; - border: 0; -} .gutter-box { + padding: 8px 0; background: #00a0e9; - padding: 5px 0; } ``` diff --git a/components/grid/demo/offset.md b/components/grid/demo/offset.md index a67e050fce..5f3e1a5fc6 100644 --- a/components/grid/demo/offset.md +++ b/components/grid/demo/offset.md @@ -19,7 +19,7 @@ title: import { Row, Col } from 'antd'; ReactDOM.render( -
+ <> col-8 @@ -39,7 +39,7 @@ ReactDOM.render( col-12 col-offset-6 -
, + , mountNode, ); ``` diff --git a/components/grid/demo/playground.md b/components/grid/demo/playground.md index 35244ad818..f6267b3446 100644 --- a/components/grid/demo/playground.md +++ b/components/grid/demo/playground.md @@ -67,47 +67,45 @@ class App extends React.Component { colCode += ` \n`; } return ( -
-
- Horizontal Gutter (px): -
- -
- Vertical Gutter (px): -
- -
- Column Count: -
- -
+ <> + Horizontal Gutter (px): +
+ +
+ Vertical Gutter (px): +
+ +
+ Column Count: +
+
{cols} {cols}
{`\n${colCode}`}
{`\n${colCode}`}
-
+ ); } } @@ -121,16 +119,17 @@ ReactDOM.render(, mountNode); border: 0; } #components-grid-demo-playground [class~='ant-col'] > div { - background: #00a0e9; height: 120px; + font-size: 14px; line-height: 120px; - font-size: 13px; + background: #0092ff; + border-radius: 4px; } #components-grid-demo-playground pre { + padding: 8px 16px; + font-size: 13px; background: #f9f9f9; border-radius: 6px; - font-size: 13px; - padding: 8px 16px; } ``` diff --git a/components/grid/demo/sort.md b/components/grid/demo/sort.md index dcd9a4bedc..2a3cbcf63a 100644 --- a/components/grid/demo/sort.md +++ b/components/grid/demo/sort.md @@ -19,16 +19,14 @@ By using `push` and`pull` class you can easily change column order. import { Row, Col } from 'antd'; ReactDOM.render( -
- - - col-18 col-push-6 - - - col-6 col-pull-18 - - -
, + + + col-18 col-push-6 + + + col-6 col-pull-18 + + , mountNode, ); ``` diff --git a/site/theme/static/markdown.less b/site/theme/static/markdown.less index 6db7a542a6..7e366eb687 100644 --- a/site/theme/static/markdown.less +++ b/site/theme/static/markdown.less @@ -128,7 +128,7 @@ } .markdown pre { - font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-family: @code-family; background: @site-markdown-code-bg; border-radius: @border-radius-base; } @@ -193,7 +193,7 @@ .markdown .anchor { margin-left: 8px; opacity: 0; - transition: opacity 0.3s ease; + transition: opacity .3s; .ant-row-rtl & { margin-right: 8px; @@ -298,6 +298,8 @@ } } +@demo-grid-color: #0092ff; + .grid-demo, [id^='components-grid-demo-'] { .demo-row, @@ -359,16 +361,15 @@ min-height: 30px; margin-top: 8px; margin-bottom: 8px; - padding: 5px 0; color: #fff; text-align: center; border-radius: 0; } .code-box-demo .ant-row > div:not(.gutter-row) { padding: 16px 0; - background: #00a0e9; + background: @demo-grid-color; &:nth-child(2n + 1) { - background: fade(#00a0e9, 70%); + background: fade(@demo-grid-color, 75%); } } .ant-row .demo-col, @@ -382,11 +383,11 @@ border: none; } .ant-row .demo-col-1 { - background: fade(#00a0e9, 70%); + background: fade(@demo-grid-color, 75%); } .ant-row .demo-col-2, .code-box-demo .ant-row .demo-col-2 { - background: fade(#00a0e9, 50%); + background: fade(@demo-grid-color, 50%); } .ant-row .demo-col-3, .code-box-demo .ant-row .demo-col-3 { @@ -395,7 +396,7 @@ } .ant-row .demo-col-4, .code-box-demo .ant-row .demo-col-4 { - background: fade(#00a0e9, 60%); + background: fade(@demo-grid-color, 60%); } .ant-row .demo-col-5, .code-box-demo .ant-row .demo-col-5 {