Skip to content

Commit

Permalink
change css config
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Jul 11, 2017
1 parent 9aca3a6 commit cee771e
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 96 deletions.
16 changes: 16 additions & 0 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export default {
},
{
test: /\.css$/,
exclude: [/icomoon\/style.css$/, /global.css$/],
use: [
'style-loader',
{
loader: 'css-loader',
options: {
// Note that we’ve set importLoaders: 1 on css-loader.
// We’re setting this because we want PostCSS to git @import statements first
modules: true,
importLoaders: 1,
localIdentName: '[path][name]__[local]--[hash:base64:5]'
},
Expand All @@ -42,6 +44,20 @@ export default {
}
],
},
{
test: /icomoon\/style.css$/,
use: [
'style-loader',
'css-loader',
],
},
{
test: /global.css$/,
use: [
'style-loader',
'css-loader',
],
},
{
test: /\.json$/,
loader: 'json-loader',
Expand Down
12 changes: 6 additions & 6 deletions src/global.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

::-webkit-scrollbar {
width: 0px;
}

:global * {
* {
user-select: none;
}

Expand All @@ -12,7 +8,7 @@ body {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
background: none;
overflow: hidden;
}
Expand Down Expand Up @@ -3240,3 +3236,7 @@ label {
.emoji_face .emoji176 {
background-position: -350px -350px
}

::-webkit-scrollbar {
width: 0px;
}
2 changes: 1 addition & 1 deletion src/js/components/Avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { Component, PropTypes } from 'react';
import clazz from 'classname';

import './style.css';
import './style.global.css';

export default class Avatar extends Component {
static propTypes = {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/js/components/Loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { Component, PropTypes } from 'react';
import Transition from 'react-addons-css-transition-group';
import clazz from 'classname';

import './style.css';
import './style.global.css';

export default class Button extends Component {
static PropTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

:global
.Loader {
position: absolute;
top: 0;
Expand Down
9 changes: 9 additions & 0 deletions src/js/components/Modal/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

:global
.Modal-overlay {
position: fixed;
top: 0;
Expand All @@ -9,6 +10,7 @@
z-index: 999;
}

:global
.Modal-header {
position: relative;
padding: 8px 20px 4px;
Expand All @@ -26,10 +28,12 @@
}
}

:global
.Modal-footer {
padding: 8px 12px;
}

:global
.Modal-content {
position: fixed;
top: 50%;
Expand All @@ -48,12 +52,14 @@
}
}

:global
.Modal-body {
padding: 12px;
background: #fff;
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

:global
.Modal-overlay-enter {
opacity: 0;
visibility: hidden;
Expand All @@ -65,6 +71,7 @@
}
}

:global
.Modal-overlay-leave {
opacity: 1;
visibility: visible;
Expand All @@ -76,6 +83,7 @@
}
}

:global
.Modal-body-enter {
transform: translate(-50%, -50%) scale(.8);
opacity: 0;
Expand All @@ -87,6 +95,7 @@
}
}

:global
.Modal-body-leave {
transform: translate(-50%, -50%);
opacity: 1;
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { Component } from 'react';

import blacklist from 'utils/blacklist';
import './style.css';
import './style.global.css';

export default class Switch extends Component {
render() {
Expand Down
File renamed without changes.
17 changes: 4 additions & 13 deletions src/js/pages/Contacts/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
--column-width: 274px;
}

:local
.columns {
display: flex;
padding-bottom: 24px;
Expand All @@ -12,7 +11,6 @@
justify-content: space-between;
}

:local
.notfound {
display: flex;
height: 100vh;
Expand All @@ -30,7 +28,6 @@
}
}

:local
.inner {
text-align: center;

Expand All @@ -40,20 +37,17 @@
}
}

:local
.column {
width: var(--column-width);
}

:local
.group {
width: var(--column-width);
padding: 8px 0;
margin-bottom: 24px;
box-shadow: 0 0 10px 0 rgba(119, 119, 119, 50%);
}

:local
.header {
position: relative;
width: 140px;
Expand All @@ -80,7 +74,6 @@
}
}

:local
.item {
display: flex;
height: 40px;
Expand All @@ -103,20 +96,19 @@
}
}

:local .avatar,
:local .info {
.avatar,
.info {
display: inline-block;
}

:local .username,
:local .signature {
.username,
.signature {
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

:local
.username {
font-family: 'Helvetica';
font-size: 14px;
Expand All @@ -125,7 +117,6 @@
margin-bottom: 4px;
}

:local
.signature {
font-family: 'Helvetica';
font-size: 12px;
Expand Down
17 changes: 7 additions & 10 deletions src/js/pages/Footer/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
--shadow-color: #eaedea;
}

:local
.footer {
position: fixed;
left: 0;
Expand Down Expand Up @@ -43,7 +42,6 @@
}
}

:local
.footer .active {
position: relative;
&:after {
Expand All @@ -61,16 +59,15 @@
}
}

:local
.right {
position: fixed;
bottom: 0;
right: 0;
width: calc(100% - 311px);
}

:local .home,
:local .contacts {
.home,
.contacts {
display: flex;
height: 60px;
align-items: center;
Expand Down Expand Up @@ -100,7 +97,7 @@
}
}

:local .home {
.home {

& .action {
width: 105px;
Expand All @@ -114,15 +111,15 @@
}
}

:local .contacts {
.contacts {
& .action {
margin-right: 17px;
display: flex;
justify-content: space-between;
}
}

:local .settings {
.settings {
display: flex;
height: 60px;
text-align: right;
Expand Down Expand Up @@ -161,7 +158,7 @@
}
}

:local .button {
.button {
position: relative;
margin-right: 17px;
width: 166px;
Expand All @@ -185,7 +182,7 @@
}
}

:local .options {
.options {
display: inline-block;
margin-right: 12px;
font-family: 'Roboto';
Expand Down
1 change: 0 additions & 1 deletion src/js/pages/Header/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

:local
.container h1 {
height: 40px;
line-height: 40px;
Expand Down
24 changes: 6 additions & 18 deletions src/js/pages/Home/ChatContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,14 @@ export default class ChatContent extends Component {

renderMessages(list, from) {
return list.map((e, index) => {
if (e.isme) {
return (
<div className={clazz(classes.message, classes.isme)} key={index}>
<div>
<Avatar src={from.HeadImgUrl} className={classes.avatar} onClick={e => this.props.showUserinfo()} />

<div className={classes.content}>
<p dangerouslySetInnerHTML={{__html: this.getMessageContent(e)}} />

<span className={classes.times}>{ moment(e.CreateTime * 1000).fromNow() }</span>
</div>
</div>
</div>
);
}

return (
<div className={classes.message} key={index}>
<div className={clazz(classes.message, {
[classes.isme]: e.isme,
[classes.isText]: e.MsgType === 1,
[classes.isImage]: e.MsgType === 3,
})} key={index}>
<div>
<Avatar src={from.HeadImgUrl} className={classes.avatar} onClick={e => this.props.showUserinfo()} />
<Avatar src={e.isme ? e.HeadImgUrl : from.HeadImgUrl} className={classes.avatar} onClick={e => this.props.showUserinfo()} />

<div className={classes.content}>
<p dangerouslySetInnerHTML={{__html: this.getMessageContent(e)}} />
Expand Down
Loading

0 comments on commit cee771e

Please sign in to comment.