Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

refactor(all components): use yandex BEM css code style #1

Merged
merged 3 commits into from
Aug 16, 2018

Conversation

Kimi-Gao
Copy link
Member

@Kimi-Gao Kimi-Gao commented Aug 4, 2018

  • Make sure that you propose PR to right branch: bugfix for master, feature for latest active branch feature-x.x.
  • Make sure that you follow earth-ui's code convention.
  • Rebase before creating a PR to keep commit history clear.
  • Add some descriptions and refer relative issues for you PR.

Description

  • Use yandex BEM css code style to rename all less/jsx class.
  • The structure of the BEM follows the pattern:
    • block-name_modifier-name
    • block-name__element-name_modifier-name
  • Use prefixCls and prefix-cls variables to replace earthui in js/less

@Kimi-Gao Kimi-Gao self-assigned this Aug 4, 2018
Copy link
Collaborator

@weiyuxuan weiyuxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -6,32 +6,32 @@
@xl: 112px;
@border-color: #d7d7d7;

.cmui-avatar {
.earthui-avatar {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could declare a variable for UI name:

@ui-prefix: earthui;

And use it in every component stylesheet like this:

@avatar-prefix: ~"@{ui-prefix}-avatar";

.@avatar-prefix {
  vertical-align: top;
}

@Kimi-Gao Kimi-Gao merged commit 1506538 into feature-0.2 Aug 16, 2018
@Kimi-Gao Kimi-Gao deleted the BEM-css-name-style branch August 16, 2018 06:06
@Kimi-Gao Kimi-Gao added PR: refactor A code change that neither fixes a bug nor adds a feature and removed type: IMPROVED labels Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants