Skip to content

Commit

Permalink
Merge pull request #9 from hiui-group/develop
Browse files Browse the repository at this point in the history
release: 2.0.0
  • Loading branch information
sivan authored Jul 17, 2019
2 parents 86f8493 + 4d70a56 commit 25aeb06
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ HIUI 模板核心样式文件,包含初始化、布局、排版等样式。
## 使用

### 组件
组件依赖直接引入 `@import '@hi-ui/core-css';`,只包含变量和函数,不会插入任何实质代码。
组件依赖直接引入 `@import '@hi-ui/core-css/index.scss';`,只包含变量和函数,不会插入任何实质代码。

### 主题
主题依赖包含了核心文件以及必备的 normalize、helper classes、排版、多语言等支持,使用方法如下:

```scss
``` scss
@import '@hi-ui/core-css/i18n/zh-CN.scss';
@import '@hi-ui/core-css/base.scss';
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ HIUI core styles, include common reset, helper classes and typography. i18n supp
## Usage

### Components
For component usage, just use `@import '@hi-ui/core-css';` imports variables and mix-ins.
For component usage, just use `@import '@hi-ui/core-css/index.scss';` imports variables and mix-ins.

### Themes
For theme usage, use code below to import variables, mix-ins, normalize, helper classes etc.

```scss
``` scss
@import '@hi-ui/core-css/i18n/zh-CN.scss';
@import '@hi-ui/core-css/base.scss';
```
Expand Down
12 changes: 7 additions & 5 deletions lib/base/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
* Description: typo styles.
*/

@import './typography/base';
@import './typography/headings';
@import './typography/lists';
@import './typography/images';
@import './typography/code';
#{$entry-selector} {
@include typoBase;
@include typoCode;
@include typoHeadings;
@include typoImages;
@include typoLists;
}
12 changes: 8 additions & 4 deletions lib/core/_palettes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
$theme-colors: (
'orange': #f63,
'cyan': #46bc99,
'magenta': #ff5975,
'lavender': #b450de,
'blue': #3da8f5,
'purple': #8a8acb,
'green': #1da653
'purple': #8a8acb
) !default;

$palette-primary: map-merge(
Expand All @@ -20,8 +21,8 @@ $palette-primary: map-merge(

$palette-secondary: (
'success': #1da653,
'danger': #eb5252,
'warning': #e19d0c
'warning': #e19d0c,
'danger': #f44141
) !default;

$palette-tertiary: (
Expand All @@ -31,13 +32,16 @@ $palette-tertiary: (
'gray': #d8d8d8,
'gray-light': #e7e7e7,
'gray-lighter': #f6f6f6,
'blue-lighter': #ecf2fe,
'white': #fff
) !default;

// Color palettes
$palette-hiui: get-palette(get-color($palette-primary, 'hiui-blue')) !default;
$palette-orange: get-palette(get-color($palette-primary, 'orange')) !default;
$palette-cyan: get-palette(get-color($palette-primary, 'cyan')) !default;
$palette-magenta: get-palette(get-color($palette-primary, 'magenta')) !default;
$palette-lavender: get-palette(get-color($palette-primary, 'lavender')) !default;
$palette-blue: get-palette(get-color($palette-primary, 'blue')) !default;
$palette-purple: get-palette(get-color($palette-primary, 'purple')) !default;

Expand Down
5 changes: 5 additions & 0 deletions lib/core/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
@import './variables';
@import './mixins';
@import './palettes';
@import './typography/base';
@import './typography/code';
@import './typography/headings';
@import './typography/images';
@import './typography/lists';
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Description: base typo reset and .entry styles.
*/

@import '../../core/index';

#{$entry-selector} {
@mixin typoBase {
@include clearfix();

// Be careful about CSS selector specificity!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Description: code preview styles.
*/

@import '../../core/index';

#{$entry-selector} {
@mixin typoCode {
code,
pre,
kbd {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Description: heading styles.
*/

@import '../../core/index';

#{$entry-selector} {
@mixin typoHeadings {
// Only reset headings at entry root
> {
h1,
Expand All @@ -15,7 +13,7 @@
h4,
h5,
h6 {
margin-top: $spacer-6;
margin-top: $spacer-10;
margin-bottom: $spacer-4;
font-weight: $font-weight-bold;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Description: image styles.
*/

@import '../../core/index';

#{$entry-selector} {
@mixin typoImages {
// Only add to imgs at entry root
> {
img,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Description: <ul>, <ol>, <dl> styles.
*/

@import '../../core/index';

#{$entry-selector} {
@mixin typoLists {
// Only add to lists at entry root
> {
ul,
Expand All @@ -31,7 +29,7 @@
}

& + li {
margin-top: $spacer-1;
margin-top: $spacer-3;
}
}
}
Expand Down
29 changes: 13 additions & 16 deletions lib/i18n/zh-CN.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ $font-family-base: $_chs-sans-font-stack, $_symbol-font-stack;
$font-family-alt: $_chs-serif-font-stack, $_symbol-font-stack;

#{$entry-selector}:lang(zh) {
> {
// 标题中文不加粗
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: $font-weight-normal;
}
// 修改中文标题文字渲染
h1,
h2,
h3,
h4,
h5,
h6 {
-webkit-font-smoothing: antialiased;
}

// 中文不使用斜体
dl {
dt {
font-style: normal;
}
}
// 中文不使用斜体
dt,
em {
font-style: normal;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hi-ui/core-css",
"version": "2.0.0-beta.3",
"version": "2.0.0",
"description": "HIUI core styles, include common reset, helper classes and typography. i18n supported.",
"main": "index.scss",
"directories": {
Expand Down

0 comments on commit 25aeb06

Please sign in to comment.