-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a39d6d
commit 0248b6f
Showing
4 changed files
with
135 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
.dui-divider { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
margin: 24px 0; | ||
|
||
&::after { | ||
position: relative; | ||
border-bottom: 1px solid $gray-400; | ||
width: 50%; | ||
content: ""; | ||
} | ||
|
||
&::before { | ||
position: relative; | ||
border-bottom: 1px solid $gray-400; | ||
width: 50%; | ||
content: ""; | ||
} | ||
|
||
.ant-divider-inner-text { | ||
padding: 0 1em; | ||
color: $black; | ||
white-space: nowrap; | ||
display: inline-block; | ||
font-weight: 500; | ||
} | ||
} | ||
|
||
.dui-divider-plain { | ||
.ant-divider-inner-text { | ||
padding: 0 1em; | ||
color: unset; | ||
font-weight: unset; | ||
} | ||
} | ||
|
||
.ant-divider-with-text-left { | ||
&::before { | ||
width: 5%; | ||
} | ||
|
||
&::after { | ||
width: 95%; | ||
} | ||
} | ||
|
||
.ant-divider-with-text-right { | ||
&::before { | ||
width: 95%; | ||
} | ||
|
||
&::after { | ||
width: 5%; | ||
} | ||
} | ||
|
||
.dui-divider-vertical { | ||
position: relative; | ||
top: -0.06em; | ||
display: inline; | ||
height: 0.9em; | ||
margin: 0 8px; | ||
vertical-align: middle; | ||
border-top: 0; | ||
border-left: 1px solid rgb(0 0 0 / 6%); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,43 @@ | ||
import React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
// import { action } from "@storybook/addon-actions"; | ||
|
||
import Divider from "./index"; | ||
|
||
const defaultDivider = () => <Divider></Divider>; | ||
const defaultDivider = () => ( | ||
<> | ||
<Divider>Text</Divider> | ||
<span>我是一段文本</span> | ||
<Divider /> | ||
<span>我是一段文本</span> | ||
</> | ||
); | ||
|
||
storiesOf("Divider 分割线", module).add("Divider", defaultDivider); | ||
const plainTextDivider = () => <Divider plain>Text</Divider>; | ||
|
||
const textOrientation = () => ( | ||
<> | ||
<Divider plain orientation="left"> | ||
Text | ||
</Divider> | ||
<span>我是一段文本</span> | ||
<Divider plain orientation="right"> | ||
Text | ||
</Divider> | ||
</> | ||
); | ||
|
||
const verticalDivider = () => ( | ||
<> | ||
Text | ||
<Divider type="vertical" /> | ||
<a href="#">Link</a> | ||
<Divider type="vertical" /> | ||
<a href="#">Link</a> | ||
</> | ||
); | ||
|
||
storiesOf("Divider 分割线", module) | ||
.add("默认分割线", defaultDivider) | ||
.add("普通文本", plainTextDivider) | ||
.add("文字对齐", textOrientation) | ||
.add("垂直方向", verticalDivider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ | |
|
||
//upload | ||
@import "../components/Upload/style"; | ||
|
||
//Divider | ||
@import "../components/Divider/style"; |