From c21f2160dc3a98a28c616d36baf9c66c04ca5af6 Mon Sep 17 00:00:00 2001 From: pichalite Date: Thu, 20 Oct 2016 21:36:54 +0000 Subject: [PATCH 1/3] generic class for bottom-sheet --- less/modules/bottom-sheet.less | 146 +++++++++---------------- templates/partials/account/menu.tpl | 2 +- templates/partials/category/sort.tpl | 2 +- templates/partials/category/tools.tpl | 2 +- templates/partials/category/watch.tpl | 2 +- templates/partials/thread_tools.tpl | 2 +- templates/partials/topic/post-menu.tpl | 2 +- templates/partials/topic/sort.tpl | 2 +- templates/partials/topic/watch.tpl | 2 +- 9 files changed, 58 insertions(+), 104 deletions(-) diff --git a/less/modules/bottom-sheet.less b/less/modules/bottom-sheet.less index 400dd81..191aff3 100644 --- a/less/modules/bottom-sheet.less +++ b/less/modules/bottom-sheet.less @@ -1,102 +1,56 @@ .bottom-sheet { - display: block; - visibility: hidden; - - position: fixed; - left: 0; - right: 0; - bottom: 0; - - margin: 0; - padding: 0 5px; - max-height: 60%; - - background: #fff; - box-shadow: 0 2px 6px rgba(0,0,0,0.35); - overflow: auto; - -webkit-overflow-scrolling: touch; - transform: translate3d(0, 350px, 0); - transition: transform 0.3s, visibility 0s 0.3s; - z-index: 995; - padding: 5px 0 10px; - - - li { - - a { - padding: 10px 20px; - } - - &.divider { - padding: 0; - } - - &.active { - background-color: @btn-primary-bg; - color: @btn-primary-color; - } - } -} - -.bottom-sheet-open { - transform: none; - visibility: visible; - transition-delay: 0s; - top: initial; -} - -@media (max-width: @screen-sm-max) { - .post-bar { - .thread-tools, [component="thread/sort"], [component="topic/watch"] { - .dropdown-menu { - .bottom-sheet; - } - - &.open { - .dropdown-menu { - .bottom-sheet-open; - } - } - - .dropdown-backdrop { - background-color: rgba(0, 0, 0, .3); - } + @media (max-width: @screen-sm-max) { + .dropdown-menu { + display: block; + visibility: hidden; + + position: fixed; + left: 0; + right: 0; + bottom: 0; + + margin: 0; + padding: 0 5px; + max-height: 60%; + + background: #fff; + box-shadow: 0 2px 6px rgba(0,0,0,0.35); + overflow: auto; + -webkit-overflow-scrolling: touch; + transform: translate3d(0, 350px, 0); + transition: transform 0.3s, visibility 0s 0.3s; + z-index: 995; + padding: 5px 0 10px; + + + li { + + a { + padding: 10px 20px; + } + + &.divider { + padding: 0; + } + + &.active { + background-color: @btn-primary-bg; + color: @btn-primary-color; + } + } } - } - - .category { - [component="topic/watch"], [component="thread/sort"], .thread-tools { + + &.open { .dropdown-menu { - .bottom-sheet; - } - - &.open { - .dropdown-menu { - .bottom-sheet-open; - } - } - - .dropdown-backdrop { - background-color: rgba(0, 0, 0, .3); - } + transform: none; + visibility: visible; + transition-delay: 0s; + top: initial; + } } - } - - .unread { - .btn-group { - .dropdown-menu { - .bottom-sheet; - } - - &.open { - .dropdown-menu { - .bottom-sheet-open; - } - } - - .dropdown-backdrop { - background-color: rgba(0, 0, 0, .3); - } + + .dropdown-backdrop { + background-color: rgba(0, 0, 0, .3); } } -} +} \ No newline at end of file diff --git a/templates/partials/account/menu.tpl b/templates/partials/account/menu.tpl index 47c4f69..e8e8700 100644 --- a/templates/partials/account/menu.tpl +++ b/templates/partials/account/menu.tpl @@ -1,4 +1,4 @@ -
+