unbreak narrow editor layout

This commit is contained in:
tophf 2017-12-07 05:31:42 +03:00
parent 9c8e835a80
commit 7a07ee9fd9
2 changed files with 64 additions and 22 deletions

View File

@ -312,7 +312,7 @@
</summary> </summary>
<div></div> <div></div>
</details> </details>
<div id="footer"> <div id="footer" class="hidden">
<a href="https://github.com/openstyles/stylus/wiki/Usercss" <a href="https://github.com/openstyles/stylus/wiki/Usercss"
i18n-text="externalUsercssDocument" i18n-text="externalUsercssDocument"
target="_blank"></a> target="_blank"></a>

View File

@ -140,11 +140,6 @@ input:invalid {
#enabled-label { #enabled-label {
vertical-align: middle; vertical-align: middle;
} }
/* actions */
#actions > * {
margin-right: 0.5rem;
margin-bottom: 0.5rem;
}
/* collapsibles */ /* collapsibles */
#header summary { #header summary {
align-items: center; align-items: center;
@ -169,6 +164,11 @@ input:invalid {
#header summary svg { #header summary svg {
margin-top: -3px; margin-top: -3px;
} }
#actions {
margin-bottom: .5rem;
}
#options:not([open]) + #lint h2 { #options:not([open]) + #lint h2 {
margin-top: 0; margin-top: 0;
} }
@ -192,7 +192,8 @@ input:invalid {
opacity: .15; opacity: .15;
} }
/* footer */ /* footer */
#footer { .usercss #footer {
display: block;
margin-top: 1em; margin-top: 1em;
margin-bottom: .5em; margin-bottom: .5em;
} }
@ -507,7 +508,8 @@ html:not(.usercss) .applies-to li:last-child .add-applies-to {
/************ lint ************/ /************ lint ************/
#lint { #lint {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;} overflow-x: hidden;
}
#lint > summary { #lint > summary {
/* workaround for overflow:auto to show the toggle triangle */ /* workaround for overflow:auto to show the toggle triangle */
position: absolute; position: absolute;
@ -664,7 +666,7 @@ html:not(.usercss) .usercss-only,
} }
/************ reponsive layouts ************/ /************ reponsive layouts ************/
@media(max-width:737px) { @media(max-width: 850px) {
#header { #header {
width: auto; width: auto;
height: auto; height: auto;
@ -673,9 +675,11 @@ html:not(.usercss) .usercss-only,
border-bottom: 1px dashed #AAA; border-bottom: 1px dashed #AAA;
min-height: var(--header-narrow-min-height); min-height: var(--header-narrow-min-height);
max-height: 50vh; max-height: 50vh;
flex-wrap: wrap;
flex-direction: row;
} }
#header section:not(:last-child) { #header section:not(:last-child) {
margin-bottom: 0.4rem; margin-bottom: .5rem;
} }
#header input[type="checkbox"] { #header input[type="checkbox"] {
vertical-align: middle; vertical-align: middle;
@ -687,6 +691,8 @@ html:not(.usercss) .usercss-only,
#basic-info { #basic-info {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
flex: 1;
margin-right: 2em;
} }
#basic-info > * { #basic-info > * {
flex: auto; flex: auto;
@ -703,15 +709,35 @@ html:not(.usercss) .usercss-only,
flex-grow: 99; flex-grow: 99;
} }
#actions { #actions {
margin-top: 1rem; margin-top: 0;
white-space: nowrap;
} }
#actions > * { #actions > * {
display: inline-block; display: inline-block;
} }
#options { #options {
-webkit-column-count: 2; -webkit-column-count: 3;
-moz-column-count: 2; -moz-column-count: 3;
column-count: 2; column-count: 3;
width: 100%;
}
#options:not([open]),
#lint:not([open]) {
column-count: 1;
overflow: initial;
}
#options:not([open]) + #lint:not([open]) {
margin-top: -1em;
}
#lint {
overflow: initial;
}
#lint summary {
position: static;
margin-bottom: 0;
}
#options summary {
margin-top: -.25em;
} }
#options h2 { #options h2 {
margin: 0 0 .5em; margin: 0 0 .5em;
@ -729,10 +755,10 @@ html:not(.usercss) .usercss-only,
top: 0.2rem; top: 0.2rem;
} }
#options:not([open]) ~ #lint { #options:not([open]) ~ #lint {
margin-top: -1ex; margin-top: -1em;
} }
#lint > div { #lint > div {
max-height: 20vh; margin-top: 0;
} }
#lint table { #lint table {
width: 100%; width: 100%;
@ -740,6 +766,9 @@ html:not(.usercss) .usercss-only,
#lint td[role="message"] { #lint td[role="message"] {
max-width: none; max-width: none;
} }
#lint:not([open]) + #footer {
margin: .25em 0 -1em .25em;
}
#sections { #sections {
padding-left: 0; padding-left: 0;
} }
@ -749,9 +778,6 @@ html:not(.usercss) .usercss-only,
#sections > *:not(h2) { #sections > *:not(h2) {
padding-left: 0.4rem; padding-left: 0.4rem;
} }
.applies-type {
width: 30%;
}
.usercss .CodeMirror-scroll { .usercss .CodeMirror-scroll {
max-height: calc(100vh - var(--header-narrow-min-height)); max-height: calc(100vh - var(--header-narrow-min-height));
} }
@ -763,13 +789,29 @@ html:not(.usercss) .usercss-only,
left: 3rem; left: 3rem;
} }
} }
@media(max-width:500px) {
@media (max-width: 720px) {
#options {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
}
}
@media (max-width: 450px) {
#options { #options {
-webkit-column-count: 1; -webkit-column-count: 1;
-moz-column-count: 1; -moz-column-count: 1;
column-count: 1; column-count: 1;
} }
#options #tabSize-label { #actions {
position: static; flex-wrap: wrap;
white-space: normal;
}
}
@supports (-moz-appearance: none) {
#header button {
padding: 0 3px 2px;
} }
} }