Merge pull request #938 from hgiesel/editorflex

Small refactor of topbar buttons
This commit is contained in:
Damien Elmes 2021-01-23 20:09:42 +10:00 committed by GitHub
commit b16f6cbcce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 10 deletions

View file

@ -34,12 +34,28 @@ body {
} }
#topbutsOuter { #topbutsOuter {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
position: sticky; position: sticky;
top: 0; top: 0;
left: 0; left: 0;
padding: 2px; padding: 2px;
} }
.topbuts > * {
margin: 0 1px;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
.topbut { .topbut {
width: 16px; width: 16px;
height: 16px; height: 16px;
@ -59,6 +75,7 @@ body {
button.linkb { button.linkb {
-webkit-appearance: none; -webkit-appearance: none;
margin-bottom: -3px;
border: 0; border: 0;
box-shadow: none; box-shadow: none;
padding: 0px 2px; padding: 0px 2px;
@ -79,12 +96,12 @@ button:focus {
} }
button.highlighted { button.highlighted {
.nightMode #topbutsleft & {
background: linear-gradient(0deg, #333333 0%, #434343 100%);
}
#topbutsleft & { #topbutsleft & {
background-color: lightgrey; background-color: lightgrey;
.nightMode & {
background: linear-gradient(0deg, #333333 0%, #434343 100%);
}
} }
#topbutsright & { #topbutsright & {

View file

@ -76,10 +76,8 @@ html { background: %s; }
</style> </style>
<div> <div>
<div id="topbutsOuter"> <div id="topbutsOuter">
<div id="topbuts" class="clearfix">
%s %s
</div> </div>
</div>
<div id="fields"> <div id="fields">
</div> </div>
</div> </div>
@ -206,10 +204,10 @@ class Editor:
righttopbtns = runFilter("setupEditorButtons", righttopbtns, self) righttopbtns = runFilter("setupEditorButtons", righttopbtns, self)
topbuts = """ topbuts = """
<div id="topbutsleft" style="float:left;"> <div id="topbutsleft" class="topbuts">
%(leftbts)s %(leftbts)s
</div> </div>
<div id="topbutsright" style="float:right;"> <div id="topbutsright" class="topbuts">
%(rightbts)s %(rightbts)s
</div> </div>
""" % dict( """ % dict(
@ -330,7 +328,7 @@ class Editor:
class_ = "" class_ = ""
if not disables: if not disables:
class_ += " perm" class_ += " perm"
return """ <button tabindex=-1 return """<button tabindex=-1
{id} {id}
class="{class_}" class="{class_}"
type="button" type="button"