Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Typography mixins. add: Created typography variables (margin, fo… #18746

Merged
merged 5 commits into from Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions components/style/mixins/index.less
Expand Up @@ -7,3 +7,4 @@
@import 'motion';
@import 'reset';
@import 'operation-unit';
@import 'typography';
49 changes: 49 additions & 0 deletions components/style/mixins/typography.less
@@ -0,0 +1,49 @@
// =============== Common ===============
.typography-paragraph() {
margin-bottom: 1em;
}

.typography-title(@fontSize; @fontWeight; @lineHeight; @headingColor; @headingMarginBottom;) {
margin-bottom: @headingMarginBottom;
color: @headingColor;
font-weight: @fontWeight;
font-size: @fontSize;
line-height: @lineHeight;
}

.typography-title-1() {
.typography-title(
@heading-1-size,
@typography-title-font-weight,
1.23,
@heading-color,
@typography-title-margin-bottom
);
}
.typography-title-2() {
.typography-title(
@heading-2-size,
@typography-title-font-weight,
1.35,
@heading-color,
@typography-title-margin-bottom
);
}
.typography-title-3() {
.typography-title(
@heading-3-size,
@typography-title-font-weight,
1.35,
@heading-color,
@typography-title-margin-bottom
);
}
.typography-title-4() {
.typography-title(
@heading-4-size,
@typography-title-font-weight,
1.4,
@heading-color,
@typography-title-margin-bottom
);
}
2 changes: 2 additions & 0 deletions components/style/themes/default.less
Expand Up @@ -681,3 +681,5 @@
// Typography
// ---
@typography-title-font-weight: 600;
@typography-title-margin-top: 1.2em;
mucluck marked this conversation as resolved.
Show resolved Hide resolved
@typography-title-margin-bottom: 0.5em;
27 changes: 0 additions & 27 deletions components/typography/style/index.less
Expand Up @@ -2,33 +2,6 @@
@import '../../style/mixins/index';

@typography-prefix-cls: ~'@{ant-prefix}-typography';
@typography-title-margin-top: 1.2em;

// =============== Common ===============
.typography-paragraph() {
margin-bottom: 1em;
}

.typography-title(@fontSize; @lineHeight) {
margin-bottom: 0.5em;
color: @heading-color;
font-weight: @typography-title-font-weight;
font-size: @fontSize;
line-height: @lineHeight;
}

.typography-title-1() {
.typography-title(@heading-1-size, 1.23);
}
.typography-title-2() {
.typography-title(@heading-2-size, 1.35);
}
.typography-title-3() {
.typography-title(@heading-3-size, 1.35);
}
.typography-title-4() {
.typography-title(@heading-4-size, 1.4);
}

// =============== Basic ===============
.@{typography-prefix-cls} {
Expand Down