Improve scrolling behaviour (#1415)

* Replace column margin with padding

This improves horizontal scrolling behaviour significantly; scrolled flex elements are... a little weird.

* Move clear column button styling to css
th-downstream
Jessica Stokes 8 years ago committed by Eugen
parent 306bdff915
commit 6907c06ce3

@ -4,16 +4,6 @@ const messages = defineMessages({
clear: { id: 'notifications.clear', defaultMessage: 'Clear notifications' } clear: { id: 'notifications.clear', defaultMessage: 'Clear notifications' }
}); });
const iconStyle = {
fontSize: '16px',
padding: '15px',
position: 'absolute',
right: '48px',
top: '0',
cursor: 'pointer',
zIndex: '2'
};
const ClearColumnButton = React.createClass({ const ClearColumnButton = React.createClass({
propTypes: { propTypes: {
@ -25,7 +15,7 @@ const ClearColumnButton = React.createClass({
const { intl } = this.props; const { intl } = this.props;
return ( return (
<div title={intl.formatMessage(messages.clear)} className='column-icon' tabIndex='0' style={iconStyle} onClick={this.props.onClick}> <div title={intl.formatMessage(messages.clear)} className='column-icon column-icon-clear' tabIndex='0' onClick={this.props.onClick}>
<i className='fa fa-eraser' /> <i className='fa fa-eraser' />
</div> </div>
); );

@ -49,6 +49,22 @@
} }
} }
.column-icon-clear {
font-size: 16px;
padding: 15px;
position: absolute;
right: 48px;
top: 0;
cursor: pointer;
z-index: 2;
}
@media screen and (min-width: 1024px) {
.column-icon-clear {
top: 10px;
}
}
.icon-button { .icon-button {
display: inline-block; display: inline-block;
padding: 0; padding: 0;
@ -714,15 +730,7 @@ a.status__content__spoiler-link {
@media screen and (min-width: 360px) { @media screen and (min-width: 360px) {
.columns-area { .columns-area {
margin: 0; padding: 10px;
}
.column:first-child, .drawer:first-child {
margin-left: 0;
}
.column:last-child, .drawer:last-child {
margin-right: 0;
} }
} }
@ -730,9 +738,12 @@ a.status__content__spoiler-link {
width: 330px; width: 330px;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
background: $color1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
> .scrollable {
background: $color1;
}
} }
.ui { .ui {
@ -764,6 +775,58 @@ a.status__content__spoiler-link {
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
.column, .drawer {
flex: 1 1 100%;
overflow: hidden;
}
@media screen and (min-width: 360px) {
.tabs-bar {
margin: 10px;
margin-bottom: 0;
}
.search {
margin-bottom: 10px;
}
}
@media screen and (max-width: 1024px) {
.column, .drawer {
width: 100%;
padding: 0;
}
.columns-area {
flex-direction: column;
}
.search__input, .autosuggest-textarea__textarea {
font-size: 16px;
}
}
@media screen and (min-width: 1024px) {
.columns-area {
padding: 0;
}
.column, .drawer {
flex: 0 0 auto;
padding: 10px;
padding-left: 5px;
padding-right: 5px;
&:first-child {
padding-left: 10px;
}
&:last-child {
padding-right: 10px;
}
}
}
@media screen and (min-width: 2560px) { @media screen and (min-width: 2560px) {
.columns-area { .columns-area {
justify-content: center; justify-content: center;
@ -823,38 +886,6 @@ a.status__content__spoiler-link {
} }
} }
.column, .drawer {
margin: 10px;
margin-left: 5px;
margin-right: 5px;
flex: 0 0 auto;
overflow: hidden;
}
.column:first-child, .drawer:first-child {
margin-left: 10px;
}
.column:last-child, .drawer:last-child {
margin-right: 10px;
}
@media screen and (max-width: 1024px) {
.column, .drawer {
width: 100%;
margin: 0;
flex: 1 1 100%;
}
.columns-area {
flex-direction: column;
}
.search__input, .autosuggest-textarea__textarea {
font-size: 16px;
}
}
.tabs-bar { .tabs-bar {
display: flex; display: flex;
background: lighten($color1, 8%); background: lighten($color1, 8%);
@ -895,27 +926,6 @@ a.status__content__spoiler-link {
} }
} }
@media screen and (min-width: 360px) {
.columns-area {
margin: 10px;
}
.tabs-bar {
margin: 10px;
margin-bottom: 0;
}
.search {
margin-bottom: 10px;
}
}
@media screen and (min-width: 1024px) {
.columns-area {
margin: 0;
}
}
@media screen and (min-width: 600px) { @media screen and (min-width: 600px) {
.tabs-bar__link { .tabs-bar__link {
span { span {
@ -1379,12 +1389,15 @@ button.active i.fa-retweet {
.empty-column-indicator { .empty-column-indicator {
color: lighten($color1, 20%); color: lighten($color1, 20%);
background: $color1;
text-align: center; text-align: center;
padding: 20px; padding: 20px;
padding-top: 100px;
font-size: 15px; font-size: 15px;
font-weight: 400; font-weight: 400;
cursor: default; cursor: default;
display: flex;
flex: 1 1 auto;
align-items: center;
a { a {
color: $color4; color: $color4;

Loading…
Cancel
Save