mirror of
https://github.com/flarum/core.git
synced 2025-02-24 11:13:40 +01:00
Mobile responsive design with a very native feel, all in pure CSS (no templating differences between versions — even though some things are in very different positions.) I’ve been working on this whole thing in my head for a while now, planning out how certain components will be laid out on the mobile version, and how to reason about them in the templates so that a substantially different layout can still be achieved by only using CSS. Today I finally wrote the CSS and it’s come together pretty damn perfectly. Still to come: - Swiping left or right on discussions to reveal controls - Tablet version
113 lines
1.9 KiB
Plaintext
113 lines
1.9 KiB
Plaintext
.dropdown-menu {
|
|
border: 0;
|
|
padding: 8px 0;
|
|
margin-top: 7px;
|
|
background: @fl-body-bg;
|
|
.box-shadow(0 2px 6px @fl-shadow-color);
|
|
|
|
& > li > a {
|
|
padding: 8px 15px;
|
|
color: @fl-body-color;
|
|
&:hover, &:focus {
|
|
color: @fl-body-color;
|
|
background-color: @fl-body-control-bg;
|
|
}
|
|
& .fa {
|
|
margin-right: 5px;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
& .divider {
|
|
margin: 10px 0;
|
|
background-color: @fl-body-control-bg;
|
|
}
|
|
}
|
|
.dropdown-split.item-count-1 {
|
|
& .btn {
|
|
border-radius: @border-radius-base !important;
|
|
}
|
|
& .dropdown-toggle {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// PHONES
|
|
@media (max-width: @screen-xs-max) {
|
|
.dropdown-open {
|
|
overflow: hidden;
|
|
}
|
|
.dropdown-menu {
|
|
margin: 0;
|
|
position: fixed;
|
|
left: 0 !important;
|
|
right: 0 !important;
|
|
width: auto !important;
|
|
bottom: -100vh;
|
|
top: auto;
|
|
padding: 0;
|
|
z-index: @zindex-modal;
|
|
display: block;
|
|
max-height: 100vh;
|
|
border-radius: 0;
|
|
.box-shadow(none);
|
|
.transition(bottom 0.3s);
|
|
|
|
&:before {
|
|
content: " ";
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 100%;
|
|
height: 200vh;
|
|
z-index: -1;
|
|
background: fade(@fl-body-primary-color, 90%);
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
.transition(opacity 0.3s);
|
|
}
|
|
& > li > a {
|
|
background: #fff;
|
|
font-size: 16px;
|
|
padding: 15px 20px;
|
|
|
|
& .fa {
|
|
font-size: 16px;
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
& .divider {
|
|
margin: 0;
|
|
}
|
|
|
|
.open & {
|
|
bottom: 0;
|
|
|
|
&:before {
|
|
opacity: 1;
|
|
pointer-events: auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// ------------------------------------
|
|
// Mixins
|
|
|
|
.expand-dropdown() {
|
|
& .dropdown-toggle {
|
|
display: none;
|
|
}
|
|
& .dropdown-menu {
|
|
display: block;
|
|
border: 0;
|
|
width: auto;
|
|
margin: 0;
|
|
padding: 0;
|
|
min-width: 0;
|
|
float: none;
|
|
position: static;
|
|
background: none;
|
|
.box-shadow(none);
|
|
}
|
|
}
|