diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs index 0f508a99d83..bc0d9fa7a67 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs +++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs @@ -36,30 +36,31 @@ class="sidebar-categories-form__category-label" for={{concat "sidebar-categories-form__input--" category.id}} > -
{{/each}} diff --git a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/categories-modal.scss b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/categories-modal.scss index fb63e63f409..ec00893c6cb 100644 --- a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/categories-modal.scss +++ b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/categories-modal.scss @@ -5,20 +5,7 @@ border: 1px solid var(--primary-low); border-left: 4px solid; margin-bottom: 1em; - padding: 0.75em; - } - - .sidebar-categories-form__input { - margin-left: auto; - margin-right: 0; - align-self: baseline; - } - - .sidebar-categories-form__category-row { - display: flex; - flex-direction: row; - margin-right: 1em; - padding: 0.5em 0; + padding: 0; } .sidebar-categories-form__category-row[data-category-level="0"]:not( @@ -44,12 +31,24 @@ .sidebar-categories-form__category-label { display: flex; - flex-direction: column; - margin-right: 0.5em; + justify-content: space-between; + padding: 0.75em 1em; + margin: 0; flex-grow: 1; + input[type="checkbox"] { + margin-right: 0; + } + } + + .sidebar-categories-form__category-wrapper { + min-width: 0; } .sidebar-categories-form__category-badge { + .badge-wrapper { + width: 100%; + } + .badge-category { white-space: normal; word-wrap: break-word; @@ -58,11 +57,15 @@ .category-name { color: var(--primary); font-size: var(--font-up-1); + @include ellipsis; } } .sidebar-categories-form__category-description { color: var(--primary-high); font-size: var(--font-down-1); + margin: 0.25em 0; + // avoids long words (like urls) from breaking the layou + word-break: break-word; } } diff --git a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/modal.scss b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/modal.scss index d34b85d6eec..202d361a2a8 100644 --- a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/modal.scss +++ b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/modal.scss @@ -1,17 +1,28 @@ -.sidebar__edit-navigation-menu__modal { +.modal.sidebar__edit-navigation-menu__modal { + @include breakpoint("tablet", min-width) { + .modal-inner-container { + width: 100%; + } + } + .modal-header { + border: none; + } .modal-body { - min-height: 25vh; + border-top: 1px solid var(--primary-low); + margin-top: 1em; + height: 40dvh; } } .sidebar__edit-navigation-menu__filter { display: flex; - flex-direction: row; - padding: 1em 1em 0 1em; + gap: 0.5em; + padding: 0 0.66em 0; + @include breakpoint("tablet", min-width) { + padding: 0 1em 0; + } .sidebar__edit-navigation-menu__filter-dropdown { - margin-left: 0.5em; - .select-kit-header { background: var(--secondary); color: var(--primary); @@ -36,6 +47,22 @@ margin-right: auto; width: 100%; position: relative; + flex: 1 1 70%; + input { + margin: 0; + } + } + + .sidebar__edit-navigation-menu__filter-dropdown-wrapper { + flex: 1 1 30%; + display: flex; + + .select-kit { + width: 100%; + summary { + height: 100%; + } + } } .sidebar__edit-navigation-menu__filter-input-icon { @@ -62,10 +89,11 @@ .sidebar__edit-navigation-menu__footer { display: flex; width: 100%; + margin-top: 0.25em; .btn.sidebar__edit-navigation-menu__reset-defaults-button { margin-left: auto; - margin-right: 0em; + margin-right: 0; .d-icon { font-size: var(--font-down-1); @@ -80,7 +108,8 @@ } .sidebar__edit-navigation-menu__deselect-wrapper { - margin: 0; + margin: 0 1em 0 0; + line-height: var(--line-height-medium); .btn-flat.sidebar__edit-navigation-menu__deselect-button { margin-left: auto; diff --git a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/tags-modal.scss b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/tags-modal.scss index dc184ed6882..71dacd39925 100644 --- a/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/tags-modal.scss +++ b/app/assets/stylesheets/common/components/sidebar/edit-navigation-menu/tags-modal.scss @@ -1,20 +1,34 @@ .sidebar-tags-form { - display: flex; - flex-wrap: wrap; + display: grid; + gap: 0 0.5em; + margin: 0; + grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); + &__no-tags { + grid-column-start: 1; + grid-column-end: -1; + } .sidebar-tags-form__tag { - flex-basis: 30%; display: flex; - flex-direction: row; align-items: center; - padding: 0.5em 0.25em; .sidebar-tags-form__tag-label { margin-bottom: 0; + min-width: 0; + padding: 0.33em 0; + @include breakpoint(tablet) { + // extra tappable space + padding: 0.5em 0; + } p { + overflow: hidden; margin: 0; } + &-name { + // avoid long tags breaking the layou + word-break: break-all; + } } .sidebar-tags-form__input { @@ -24,5 +38,6 @@ .sidebar-tags-form__tag-label-count { color: var(--primary-medium); + margin-left: 0.33em; } } diff --git a/app/assets/stylesheets/desktop/components/_index.scss b/app/assets/stylesheets/desktop/components/_index.scss index b895bd68565..3ae19fc49c3 100644 --- a/app/assets/stylesheets/desktop/components/_index.scss +++ b/app/assets/stylesheets/desktop/components/_index.scss @@ -1,5 +1,3 @@ -@import "sidebar/edit-navigation-menu/categories-modal"; -@import "sidebar/edit-navigation-menu/tags-modal"; @import "user-card"; @import "user-info"; @import "user-stream-item"; diff --git a/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/categories-modal.scss b/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/categories-modal.scss deleted file mode 100644 index 443c1798d1f..00000000000 --- a/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/categories-modal.scss +++ /dev/null @@ -1,5 +0,0 @@ -.sidebar-categories-form-modal { - .modal-inner-container { - min-width: var(--modal-max-width); - } -} diff --git a/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/tags-modal.scss b/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/tags-modal.scss deleted file mode 100644 index d24fa57f48c..00000000000 --- a/app/assets/stylesheets/desktop/components/sidebar/edit-navigation-menu/tags-modal.scss +++ /dev/null @@ -1,5 +0,0 @@ -.sidebar__edit-navigation-menu__tags-modal { - .modal-inner-container { - min-width: var(--modal-max-width); - } -} diff --git a/app/assets/stylesheets/mobile/components/_index.scss b/app/assets/stylesheets/mobile/components/_index.scss index 00e6ac8523e..89eb683655c 100644 --- a/app/assets/stylesheets/mobile/components/_index.scss +++ b/app/assets/stylesheets/mobile/components/_index.scss @@ -1,5 +1,3 @@ -@import "sidebar/edit-navigation-menu/modal"; -@import "sidebar/edit-navigation-menu/tags-modal"; @import "topic-footer-mobile-dropdown"; @import "user-card"; @import "user-stream-item"; diff --git a/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/modal.scss b/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/modal.scss deleted file mode 100644 index c1732330eee..00000000000 --- a/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/modal.scss +++ /dev/null @@ -1,15 +0,0 @@ -.sidebar__edit-navigation-menu { - .modal-inner-container { - width: 35em; - } -} - -.sidebar__edit-navigation-menu__filter { - flex-direction: column; - padding: 0.667em; - - .sidebar__edit-navigation-menu__filter-dropdown { - margin-left: 0; - width: 100%; - } -} diff --git a/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/tags-modal.scss b/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/tags-modal.scss deleted file mode 100644 index 33fc08abcf2..00000000000 --- a/app/assets/stylesheets/mobile/components/sidebar/edit-navigation-menu/tags-modal.scss +++ /dev/null @@ -1,11 +0,0 @@ -.sidebar__edit-navigation-menu__tags-modal { - .modal-inner-container { - width: 35em; - } -} - -.sidebar-tags-form { - .sidebar-tags-form__tag { - flex-basis: 100%; - } -}