1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

Make stuff responsive. closes #6

This commit is contained in:
Toby Zerner
2015-06-24 11:48:15 +09:30
parent 1ea91dc707
commit 1acfb19800
4 changed files with 68 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
import FormModal from 'flarum/components/form-modal'; import FormModal from 'flarum/components/form-modal';
import DiscussionPage from 'flarum/components/discussion-page'; import DiscussionPage from 'flarum/components/discussion-page';
import highlight from 'flarum/helpers/highlight'; import highlight from 'flarum/helpers/highlight';
import icon from 'flarum/helpers/icon';
import classList from 'flarum/utils/class-list'; import classList from 'flarum/utils/class-list';
import tagLabel from 'flarum-tags/helpers/tag-label'; import tagLabel from 'flarum-tags/helpers/tag-label';
@@ -89,7 +90,9 @@ export default class TagDiscussionModal extends FormModal {
onblur: () => this.focused(false) onblur: () => this.focused(false)
}) })
]), ]),
m('button[type=submit].btn.btn-primary', {disabled: !selected.length}, 'Confirm') m('span.primary-control',
m('button[type=submit].btn.btn-primary', {disabled: !selected.length}, icon('check icon'), m('span.label', 'Confirm'))
)
]) ])
], ],
footer: [ footer: [

View File

@@ -16,7 +16,7 @@ export default class TagNavItem extends NavItem {
} }
return m('li'+(active ? '.active' : ''), return m('li'+(active ? '.active' : ''),
m('a', { m('a.has-icon', {
href: this.props.href, href: this.props.href,
config: m.route, config: m.route,
onclick: () => { onclick: () => {

View File

@@ -56,9 +56,10 @@ export default class TagsPage extends Component {
]), ]),
cloud.length ? m('div.tag-cloud', [ cloud.length ? m('div.tag-cloud', [
m('h4', 'Tags'), m('h4', 'Tags'),
m('div.tag-cloud-content', cloud.map(tag => m('div.tag-cloud-content', cloud.map(tag => [
m('a', {href: app.route.tag(tag), config: m.route, style: tag.color() ? 'color: '+tag.color() : ''}, tag.name()) m('a', {href: app.route.tag(tag), config: m.route, style: tag.color() ? 'color: '+tag.color() : ''}, tag.name()),
)) ' '
]))
]) : '' ]) : ''
]) ])
]) ])

View File

@@ -100,33 +100,43 @@
.tag-discussion-modal { .tag-discussion-modal {
& .modal-header { & .modal-header {
background: @fl-body-secondary-color; background: @fl-body-secondary-color;
padding: 20px; padding: 20px 20px 0;
& h3 { & h3 {
text-align: left; text-align: left;
color: @fl-body-muted-color; color: @fl-body-muted-color;
font-size: 16px; font-size: 16px;
} }
@media @phone {
padding: 0;
}
} }
& .modal-body { & .modal-body {
padding: 0 20px 20px; padding: 20px;
@media @phone {
padding: 15px;
}
} }
& .modal-footer { & .modal-footer {
padding: 1px 0 0; padding: 1px 0 0;
text-align: left; text-align: left;
} }
} }
.tags-form { @media @tablet, @desktop, @desktop-hd {
padding-right: 100px; .tags-form {
overflow: hidden; padding-right: 100px;
overflow: hidden;
& .tags-input { & .tags-input {
float: left; float: left;
} }
& .btn { & .primary-control {
margin-right: -100px; margin-right: -100px;
float: right; float: right;
width: 85px; width: 85px;
}
} }
} }
.tags-input { .tags-input {
@@ -161,6 +171,10 @@
overflow: auto; overflow: auto;
max-height: 50vh; max-height: 50vh;
@media @phone {
max-height: none;
}
& > li { & > li {
padding: 7px 20px; padding: 7px 20px;
overflow: hidden; overflow: hidden;
@@ -189,10 +203,18 @@
width: 150px; width: 150px;
margin-right: 10px; margin-right: 10px;
margin-left: 10px; margin-left: 10px;
@media @phone {
width: auto;
}
} }
& .description { & .description {
color: @fl-body-muted-color; color: @fl-body-muted-color;
font-size: 12px; font-size: 12px;
@media @phone {
display: none;
}
} }
&.selected { &.selected {
& .tag-icon { & .tag-icon {
@@ -226,25 +248,31 @@
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
@media @phone {
margin: -15px -15px 0;
}
& > li { & > li {
float: left;
width: ~"calc(50% - 1px)";
height: 200px; height: 200px;
margin-right: 1px;
margin-bottom: 1px; margin-bottom: 1px;
overflow: hidden; overflow: hidden;
&:first-child { @media @tablet, @desktop, @desktop-hd {
border-top-left-radius: @border-radius-base; float: left;
} width: ~"calc(50% - 1px)";
&:nth-child(2) { margin-right: 1px;
border-top-right-radius: @border-radius-base; &:first-child {
} border-top-left-radius: @border-radius-base;
&:nth-last-child(2):nth-child(even), &:last-child { }
border-bottom-right-radius: @border-radius-base; &:nth-child(2) {
} border-top-right-radius: @border-radius-base;
&:nth-last-child(2):nth-child(odd), &:last-child:nth-child(odd) { }
border-bottom-left-radius: @border-radius-base; &:nth-last-child(2):nth-child(even), &:last-child {
border-bottom-right-radius: @border-radius-base;
}
&:nth-last-child(2):nth-child(odd), &:last-child:nth-child(odd) {
border-bottom-left-radius: @border-radius-base;
}
} }
} }
} }
@@ -303,6 +331,9 @@
padding-top: 17px; padding-top: 17px;
padding-bottom: 17px; padding-bottom: 17px;
color: fade(#fff, 50%); color: fade(#fff, 50%);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
& .title { & .title {
margin-right: 15px; margin-right: 15px;
@@ -310,7 +341,7 @@
} }
} }
.tag-cloud { .tag-cloud {
margin-top: 30px; margin-top: 50px;
text-align: center; text-align: center;
& h4 { & h4 {
@@ -330,6 +361,7 @@
} }
.tag-cloud-content { .tag-cloud-content {
font-size: 14px; font-size: 14px;
line-height: 1.7;
&, & a { &, & a {
color: @fl-body-muted-color; color: @fl-body-muted-color;