pot-375 - Making modals compatible with themes

Этот коммит содержится в:
Asaad Mahmood
2015-10-01 09:33:21 +05:00
родитель 53bdc34f37
Коммит 813792dd60
18 изменённых файлов: 51 добавлений и 52 удалений

Просмотреть файл

@@ -24,7 +24,7 @@ export default class PremadeThemeChooser extends React.Component {
premadeThemes.push( premadeThemes.push(
<div <div
className='col-sm-3 premade-themes' className='col-xs-6 col-sm-3 premade-themes'
key={'premade-theme-key' + k} key={'premade-theme-key' + k}
> >
<div <div
@@ -34,7 +34,7 @@ export default class PremadeThemeChooser extends React.Component {
<label> <label>
<img <img
className='img-responsive' className='img-responsive'
src={'/static/images/themes/' + premadeTheme.type.toLowerCase() + '.png'} src={'/static/images/themes/' + premadeTheme.type.toLowerCase() + '.jpg'}
/> />
<div className='theme-label'>{Utils.toTitleCase(premadeTheme.type)}</div> <div className='theme-label'>{Utils.toTitleCase(premadeTheme.type)}</div>
</label> </label>

Просмотреть файл

@@ -214,14 +214,15 @@ export default class UserSettingsAppearance extends React.Component {
<div className='divider-dark first'/> <div className='divider-dark first'/>
{themeUI} {themeUI}
<div className='divider-dark'/> <div className='divider-dark'/>
<br/>
<a
href='#'
className='theme'
onClick={this.handleImportModal}
>
{'Import from Slack'}
</a>
</div> </div>
<br/>
<a
className='theme'
onClick={this.handleImportModal}
>
{'Import from Slack'}
</a>
</div> </div>
); );
} }

Просмотреть файл

@@ -179,7 +179,7 @@ module.exports = {
centerChannelColor: '#DDDDDD', centerChannelColor: '#DDDDDD',
newMessageSeparator: '#5de5da', newMessageSeparator: '#5de5da',
linkColor: '#A4FFEB', linkColor: '#A4FFEB',
buttonBg: '#1dacfc', buttonBg: '#4CBBA4',
buttonColor: '#FFFFFF' buttonColor: '#FFFFFF'
}, },
windows10: { windows10: {

Просмотреть файл

@@ -395,35 +395,39 @@ export function toTitleCase(str) {
export function applyTheme(theme) { export function applyTheme(theme) {
if (theme.sidebarBg) { if (theme.sidebarBg) {
changeCss('.sidebar--left', 'background:' + theme.sidebarBg, 1); changeCss('.sidebar--left, .settings-modal .settings-table .settings-links, .sidebar--menu', 'background:' + theme.sidebarBg, 1);
} }
if (theme.sidebarText) { if (theme.sidebarText) {
changeCss('.sidebar--left .nav li>a, .sidebar--right', 'color:' + theme.sidebarText, 1); changeCss('.sidebar--left .nav li>a, .sidebar--right, .settings-modal .nav-pills>li a, .sidebar--menu', 'color:' + theme.sidebarText, 1);
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li>a', 'color:' + theme.sidebarText, 1);
changeCss('.sidebar--left .nav li>h4, .sidebar--left .add-channel-btn', 'color:' + changeOpacity(theme.sidebarText, 0.8), 1); changeCss('.sidebar--left .nav li>h4, .sidebar--left .add-channel-btn', 'color:' + changeOpacity(theme.sidebarText, 0.8), 1);
changeCss('.sidebar--left .add-channel-btn:hover, .sidebar--left .add-channel-btn:focus', 'color:' + theme.sidebarText, 1); changeCss('.sidebar--left .add-channel-btn:hover, .sidebar--left .add-channel-btn:focus', 'color:' + theme.sidebarText, 1);
changeCss('.sidebar--left, .sidebar--right .sidebar--right__header', 'border-color:' + changeOpacity(theme.sidebarText, 0.2), 1); changeCss('.sidebar--left, .sidebar--right .sidebar--right__header', 'border-color:' + changeOpacity(theme.sidebarText, 0.2), 1);
changeCss('.sidebar--left .status path', 'fill:' + changeOpacity(theme.sidebarText, 0.5), 1); changeCss('.sidebar--left .status path', 'fill:' + changeOpacity(theme.sidebarText, 0.5), 1);
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li>a', 'border-color:' + changeOpacity(theme.sidebarText, 0.2), 2);
} }
if (theme.sidebarUnreadText) { if (theme.sidebarUnreadText) {
changeCss('.sidebar--left .nav li>a.unread-title', 'color:' + theme.sidebarUnreadText + '!important;', 1); changeCss('.sidebar--left .nav li>a.unread-title', 'color:' + theme.sidebarUnreadText + '!important;', 2);
} }
if (theme.sidebarTextHoverBg) { if (theme.sidebarTextHoverBg) {
changeCss('.sidebar--left .nav li>a:hover, .sidebar--left .nav li>a:focus', 'background:' + theme.sidebarTextHoverBg, 1); changeCss('.sidebar--left .nav li>a:hover, .sidebar--left .nav li>a:focus, .settings-modal .nav-pills>li:hover a, .settings-modal .nav-pills>li:focus a', 'background:' + theme.sidebarTextHoverBg, 1);
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li:hover a', 'background:' + theme.sidebarTextHoverBg, 1);
} }
if (theme.sidebarTextHoverColor) { if (theme.sidebarTextHoverColor) {
changeCss('.sidebar--left .nav li>a:hover, .sidebar--left .nav li>a:focus', 'color:' + theme.sidebarTextHoverColor, 2); changeCss('.sidebar--left .nav li>a:hover, .sidebar--left .nav li>a:focus, .settings-modal .nav-pills>li:hover a, .settings-modal .nav-pills>li:focus a', 'color:' + theme.sidebarTextHoverColor, 2);
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li:hover a', 'color:' + theme.sidebarTextHoverColor, 2);
} }
if (theme.sidebarTextActiveBg) { if (theme.sidebarTextActiveBg) {
changeCss('.sidebar--left .nav li.active a, .sidebar--left .nav li.active a:hover, .sidebar--left .nav li.active a:focus', 'background:' + theme.sidebarTextActiveBg, 1); changeCss('.sidebar--left .nav li.active a, .sidebar--left .nav li.active a:hover, .sidebar--left .nav li.active a:focus, .settings-modal .nav-pills>li.active a, .settings-modal .nav-pills>li.active a:hover, .settings-modal .nav-pills>li.active a:active', 'background:' + theme.sidebarTextActiveBg, 1);
} }
if (theme.sidebarTextActiveColor) { if (theme.sidebarTextActiveColor) {
changeCss('.sidebar--left .nav li.active a, .sidebar--left .nav li.active a:hover, .sidebar--left .nav li.active a:focus', 'color:' + theme.sidebarTextActiveColor, 2); changeCss('.sidebar--left .nav li.active a, .sidebar--left .nav li.active a:hover, .sidebar--left .nav li.active a:focus, .settings-modal .nav-pills>li.active a, .settings-modal .nav-pills>li.active a:hover, .settings-modal .nav-pills>li.active a:active', 'color:' + theme.sidebarTextActiveColor, 2);
} }
if (theme.sidebarHeaderBg) { if (theme.sidebarHeaderBg) {
@@ -458,7 +462,7 @@ export function applyTheme(theme) {
} }
if (theme.centerChannelBg) { if (theme.centerChannelBg) {
changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .command-box', 'background:' + theme.centerChannelBg, 1); changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .command-box, .modal .modal-content', 'background:' + theme.centerChannelBg, 1);
changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1); changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1);
changeCss('#post-create', 'background:' + theme.centerChannelBg, 1); changeCss('#post-create', 'background:' + theme.centerChannelBg, 1);
changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1); changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1);
@@ -467,7 +471,7 @@ export function applyTheme(theme) {
} }
if (theme.centerChannelColor) { if (theme.centerChannelColor) {
changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .loading-screen .loading__content .round, .command-name', 'color:' + theme.centerChannelColor, 1); changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .loading-screen .loading__content .round, .command-name, .modal .modal-content', 'color:' + theme.centerChannelColor, 1);
changeCss('#post-create', 'color:' + theme.centerChannelColor, 2); changeCss('#post-create', 'color:' + theme.centerChannelColor, 2);
changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3); changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3);
changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2); changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2);
@@ -477,7 +481,7 @@ export function applyTheme(theme) {
changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .modal .modal-header', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.command-name', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.command-name', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1); changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1);
changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2); changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2);
@@ -487,14 +491,15 @@ export function applyTheme(theme) {
changeCss('.search-bar__container .search__form', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.search-bar__container .search__form', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.channel-intro .channel-intro__content', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1); changeCss('.channel-intro .channel-intro__content', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1);
changeCss('.date-separator .separator__text', 'color:' + theme.centerChannelColor, 2); changeCss('.date-separator .separator__text', 'color:' + theme.centerChannelColor, 2);
changeCss('.date-separator .separator__hr, .post-right__container .post.post--root hr, .search-item-container', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.date-separator .separator__hr, .modal-footer, .modal .custom-textarea, .post-right__container .post.post--root hr, .search-item-container', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.channel-intro', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.modal .custom-textarea:focus', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.3), 1);
changeCss('.channel-intro, .settings-modal .settings-table .settings-content .divider-dark, hr, .settings-modal .settings-table .settings-links', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment, .post.post--comment.other--root .post-comment, .post.same--root .post-body', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment, .post.post--comment.other--root .post-comment, .post.same--root .post-body', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('.post:hover, .sidebar--right .sidebar--right__header', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.post:hover, .sidebar--right .sidebar--right__header, .settings-modal .settings-table .settings-content .section-min:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.date-separator.hovered--before:after, .new-separator.hovered--before:after', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.date-separator.hovered--before:after, .new-separator.hovered--before:after', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.date-separator.hovered--after:before, .new-separator.hovered--after:before, .command-name:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.date-separator.hovered--after:before, .new-separator.hovered--after:before, .command-name:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.post.current--user:hover .post-body ', 'background: none;', 1); changeCss('.post.current--user:hover .post-body ', 'background: none;', 1);
@@ -507,7 +512,7 @@ export function applyTheme(theme) {
} }
if (theme.linkColor) { if (theme.linkColor) {
changeCss('a, a:focus, a:hover', 'color:' + theme.linkColor, 1); changeCss('a, a:focus, a:hover, .btn, .btn:focus, .btn:hover', 'color:' + theme.linkColor, 1);
changeCss('.post .comment-icon__container', 'fill:' + theme.linkColor, 1); changeCss('.post .comment-icon__container', 'fill:' + theme.linkColor, 1);
} }

Просмотреть файл

@@ -68,6 +68,19 @@ a:focus, a:hover {
margin: 0; margin: 0;
} }
.text-danger {
color: #E05F5D;
}
.btn {
&.btn-danger {
color: #fff;
&:hover, &:active {
color: #fff;
}
}
}
.form-control { .form-control {
@include border-radius(2px); @include border-radius(2px);
&.no-resize { &.no-resize {

Просмотреть файл

@@ -9,12 +9,6 @@
@include opacity(0.7); @include opacity(0.7);
} }
} }
a, a:focus, a:hover {
color: #2389D7;
&.text-danger {
color: #a94442;
}
}
.custom-textarea { .custom-textarea {
color: inherit; color: inherit;
border-color: #ccc; border-color: #ccc;
@@ -25,12 +19,9 @@
} }
.btn { .btn {
font-size: 13px; font-size: 13px;
&.btn-primary { &.btn-default {
background: #4285f4; border: none;
&:hover, &:focus, &:active { background: transparent;
background: $primary-color--hover;
color: #fff;
}
} }
} }
.info__label { .info__label {
@@ -70,7 +61,7 @@
background: $primary-color; background: $primary-color;
color: #FFF; color: #FFF;
padding: 15px 15px 11px; padding: 15px 15px 11px;
border: none; border: 1px solid #ddd;
min-height: 56px; min-height: 56px;
@include clearfix; @include clearfix;
.modal-title { .modal-title {

Просмотреть файл

@@ -402,12 +402,6 @@
margin-left: 7px; margin-left: 7px;
} }
} }
&.active, &:hover {
a {
color: #555;
background: #fff;
}
}
} }
} }
} }

Просмотреть файл

@@ -2,7 +2,6 @@
@import "activity-log"; @import "activity-log";
.user-settings { .user-settings {
background: #fff;
min-height:300px; min-height:300px;
.table-responsive { .table-responsive {
max-width: 560px; max-width: 560px;
@@ -71,7 +70,7 @@
} }
.section-max { .section-max {
background: #f2f2f2; background: rgba(black, 0.05);
padding: 1em 0 1.3em; padding: 1em 0 1.3em;
margin-bottom: 0; margin-bottom: 0;
@include clearfix; @include clearfix;
@@ -121,7 +120,7 @@
.fa { .fa {
margin-right: 7px; margin-right: 7px;
font-size: 12px; font-size: 12px;
color: #aaa; @include opacity(0.5);
display: none; display: none;
} }
} }
@@ -131,7 +130,7 @@
} }
.section-describe { .section-describe {
color:grey; @include opacity(0.7);
} }
.divider-dark { .divider-dark {
@@ -167,15 +166,11 @@
} }
} }
.control-label { .control-label {
color: #555;
font-weight: 600; font-weight: 600;
&.text-left { &.text-left {
text-align: left; text-align: left;
} }
} }
hr {
border-color: #ccc;
}
} }
.file-status { .file-status {

Просмотреть файл

@@ -54,7 +54,7 @@
> a { > a {
font-size: 15px; font-size: 15px;
background: none !important; background: none !important;
color: #444; color: inherit;
line-height: 40px; line-height: 40px;
padding: 0 15px; padding: 0 15px;
.glyphicon { .glyphicon {

Двоичные данные
web/static/images/themes/mattermost dark.jpg Обычный файл

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 23 KiB

Двоичные данные
web/static/images/themes/mattermost dark.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 74 KiB

Двоичные данные
web/static/images/themes/mattermost.jpg Обычный файл

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичные данные
web/static/images/themes/mattermost.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 65 KiB

Двоичные данные
web/static/images/themes/organization.jpg Обычный файл

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Двоичные данные
web/static/images/themes/organization.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 84 KiB

Двоичные данные
web/static/images/themes/slack.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 67 KiB

Двоичные данные
web/static/images/themes/windows dark.jpg Обычный файл

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 29 KiB

Двоичные данные
web/static/images/themes/windows dark.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 81 KiB