Skip to content

Commit

Permalink
feat(css): improve responsive design for bars
Browse files Browse the repository at this point in the history
  • Loading branch information
vednoc committed May 21, 2021
1 parent 8067200 commit c496da7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
13 changes: 13 additions & 0 deletions scss/ui/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,16 @@ label[for="remember"] {
}

#share { min-width: 300px }

@media screen and (max-width: 1180px) {
.header {
flex-flow: row wrap;
> .share { width: 100% }
> .actions {
order: -1;
margin: 0 0 1rem;
flex-flow: row wrap;
.btn { margin-bottom: 0.5rem }
}
}
}
10 changes: 0 additions & 10 deletions scss/ui/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,6 @@
}
}

// TODO: Figure out how to deal with responsive design.
.preview + section .header {
@media screen and (max-width: 640px) {
flex-wrap: wrap;
h1 { width: 100%; text-align: center }
*:nth-child(2) { margin-left: auto !important }
*:last-of-type { margin-right: auto }
}
}

.grid {
@media screen and (max-width: 1280px) {
.col { flex-basis: calc(100% / 3 - 1rem) }
Expand Down
4 changes: 4 additions & 0 deletions scss/ui/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ footer {
border-top: 1px solid var(--bg-4);
background-color: var(--bg-2);

ul {
flex-flow: row wrap;
}

li {
list-style: none;
&:not(:last-child)::after {
Expand Down
2 changes: 1 addition & 1 deletion static/css/main.css

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions views/style.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 class="mb:m">{{ .Style.Name -}}
<section class="mt:l">
<div class="header flex mb:m ai:c">
{{ if .Slug }}
<div class="share flex ai:c">
<div class="share flex ai:c mr:m">
<span class="mr:s">Share style</span>
<input
id="share"
Expand All @@ -46,16 +46,16 @@ <h1 class="mb:m">{{ .Style.Name -}}
<span class="actions flex ml:a">
{{ if eq .User.ID .Style.UserID }}
<form class="unset" method="post" action="/style/{{ .Style.ID }}">
<button class="btn" type="submit">Delete</button>
<button class="btn mr:s" type="submit">Delete</button>
</form>
<a
href="/edit/{{ .Style.ID }}"
class="btn ml:s"
class="btn mr:s"
>Edit</a>
{{ end }}
{{ if ge .User.Role 1 }}
<form class="unset" method="post" action="/style/{{ .Style.ID }}/promote">
<button class="btn ml:s" type="submit"
<button class="btn mr:s" type="submit"
tooltip-data='Promote this style. The style will then be featured on the home page. If this style has already been promoted it will be removed as being promoted.'
>
🌟</button>
Expand All @@ -66,20 +66,20 @@ <h1 class="mb:m">{{ .Style.Name -}}
target="_blank"
rel="noopener"
href="{{ .Style.Homepage }}"
class="btn ml:s"
class="btn mr:s"
>Project homepage</a>
{{ end }}
<a
target="_blank"
rel="noopener"
href="/api/style/{{ .Style.ID }}.user.css"
id="install" class="btn primary ml:s"
id="install" class="btn primary mr:s"
>Install userstyle</a>
<a
target="_blank"
rel="noopener"
href="https://github.com/openstyles/stylus/#readme"
id="stylus" class="btn stylus ml:s"
id="stylus" class="btn stylus"
>Get Stylus</a>
</span>
</div>
Expand Down

0 comments on commit c496da7

Please sign in to comment.