Skip to content

Commit

Permalink
针对rem时的样式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Aug 22, 2017
1 parent a549c80 commit 970772f
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 29 deletions.
1 change: 1 addition & 0 deletions components/Modal/ModalFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ModalFooter extends PureComponent {
const cls = classnames({
[`${prefixCls}`]: true,
[className]: !!className,
// block: true,
});

return (
Expand Down
2 changes: 0 additions & 2 deletions components/Swipe/Swipe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,9 @@ class Swipe extends Component {

if (!this.isDirectionX()) {
style.items.height = height;
style.pagination.marginTop = 3;
} else {
style.items.whiteSpace = 'nowrap';
style.pagination.display = 'inline-block';
style.pagination.marginRight = 3;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion examples/components/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Container extends Component {
return (
<div className={cls} style={{ minHeight: window.innerHeight }}>
<a className="github" href="https://github.com/ZhonganTechENG/zarm">
<svg aria-hidden="true" height="32" version="1.1" viewBox="0 0 16 16" width="32">
<svg aria-hidden="true" version="1.1" viewBox="0 0 16 16">
<path fillRule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" />
</svg>
</a>
Expand Down
7 changes: 4 additions & 3 deletions examples/pages/CellPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Icon, Cell, Message, Input } from '../../components';
import '../styles/pages/CellPage';

const img = require('../images/icons/state.png');

Expand Down Expand Up @@ -72,9 +73,9 @@ class Page extends Component {
<Cell
hasArrow
title={
<div>
<div>标题文字</div>
<div style={{ fontSize: 12, color: 'gray' }}>描述文字</div>
<div className="box">
<div className="box-title">标题文字</div>
<div className="box-description">描述文字</div>
</div>
}
description="附加提示"
Expand Down
2 changes: 1 addition & 1 deletion examples/pages/IconPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Page extends Component {
ICONS.sort().map((icon, i) => {
return (
<div className="grid-column" key={+i}>
<Icon theme="primary" type={icon} />
<Icon className="icon" theme="primary" type={icon} />
<span className="icon-name">{icon}</span>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions examples/pages/MessagePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Page extends Component {
</Panel>
<Panel>
<Panel.Header>
<Panel.Title>模式</Panel.Title>
<Panel.Title>可操作</Panel.Title>
</Panel.Header>
<Panel.Body>
<Message theme="warning" mode="link">链接模式</Message>
<Message theme="error" mode="closable">可关闭模式</Message>
<Message hasArrow theme="warning" onClick={() => alert('click this message!')}>链接样式的</Message>
<Message hasClosable theme="error">可关闭的</Message>
</Panel.Body>
</Panel>
</main>
Expand Down
7 changes: 4 additions & 3 deletions examples/pages/ToastPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Cell, Toast, Loading, Button, Icon } from '../../components';
import '../styles/pages/ToastPage';

class ToastPage extends Component {

Expand Down Expand Up @@ -56,9 +57,9 @@ class ToastPage extends Component {
toast.visible = true;
toast.duration = 3000;
toast.children = (
<div>
<Icon type="right-round-fill" style={{ fontSize: '3rem' }} />
<div style={{ marginBottom: 5 }}>预约成功</div>
<div className="box">
<Icon className="box-icon" type="right-round-fill" />
<div className="box-text">预约成功</div>
</div>
);
this.setState({ toast });
Expand Down
2 changes: 2 additions & 0 deletions examples/styles/components/Container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
position: absolute;
right: r(10);
top: r(10);
width: r(32);
height: r(32);
}
}

10 changes: 10 additions & 0 deletions examples/styles/pages/CellPage.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "../core/func";

.cell-page {
.box {
&-description {
font-size: r(12);
color: gray;
}
}
}
12 changes: 6 additions & 6 deletions examples/styles/pages/IconPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
@import "../core/func";

.icon-page {
.icon-name {
font-size: r(13);
}

.za-icon {
.icon {
display: block;
font-size: 45px;
margin-bottom: r(15);
font-size: r(45);

&-name {
font-size: r(13);
}
}

.grid {
Expand Down
1 change: 1 addition & 0 deletions examples/styles/pages/PopupPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
padding: r(10);
background: rgba(0, 0, 0, .7);
color: #fff;
font-size: r(14);
text-align: center;
}
}
13 changes: 13 additions & 0 deletions examples/styles/pages/ToastPage.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import "../core/func";

.toast-page {
.box {
&-icon {
font-size: r(50);
}

&-text {
margin-bottom: r(5);
}
}
}
1 change: 1 addition & 0 deletions styles/components/ActionSheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $prefixCls: za-actionsheet;
&:hover,
&:focus,
&:visited {
text-decoration: none;
color: $color;
}
}
Expand Down
16 changes: 11 additions & 5 deletions styles/components/Modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ $prefixCls: za-modal;
display: flex;
width: 100%;

&.block {
display: block;
}

.za-button {
a {
flex: 1;
height: r(50);
line-height: r(50);
Expand All @@ -97,5 +93,15 @@ $prefixCls: za-modal;
@include onepx(left top);
}
}

&.block {
display: block;

a {
&:not(:first-of-type) {
@include onepx(top);
}
}
}
}
}
2 changes: 1 addition & 1 deletion styles/components/Picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ $picker-stackitem-height: r(35);
position: relative;
padding: 0 r(10);
line-height: $picker-stackitem-height;
font-size: r(14);
font-size: r(16);
color: #333;
transition: padding-left .4s;
white-space: nowrap;
Expand Down
5 changes: 3 additions & 2 deletions styles/components/Swipe.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ $prefixCls: za-swipe;
.#{$prefixCls} {
position: relative;
overflow: hidden;
font-size: 0;

&-item {
display: inline-block;
width: 100%;
height: 100%;
font-size: r(16);
font-size: r(14);
}

&-pagination {
Expand All @@ -21,13 +20,15 @@ $prefixCls: za-swipe;
list-style: none;
margin: 0;
padding: 0;
font-size: 0;

li {
width: r(8);
height: r(8);
border-radius: r(4);
background: #ccc;
cursor: pointer;
margin: r(3) 0 0 r(3);

&.active {
background: $theme-primary;
Expand Down
4 changes: 2 additions & 2 deletions styles/components/Switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $prefixCls: za-switch;
position: relative;
width: r(51);
height: r(31);
border: 1px solid #e5e5e5;
border: r(1) solid #e5e5e5;
border-radius: r(15.5);
background-color: #e5e5e5;
vertical-align: middle;
Expand All @@ -43,7 +43,7 @@ $prefixCls: za-switch;
&:after {
width: r(29);
background-color: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
box-shadow: 0 r(1) r(3) rgba(0, 0, 0, 0.4);
transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
}

Expand Down
1 change: 1 addition & 0 deletions styles/components/Tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ $prefixCls: za-tab;

&-item {
display: none;
font-size: r(14);

&.active {
display: block;
Expand Down

0 comments on commit 970772f

Please sign in to comment.