diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-02 15:49:11 +0300 |
---|---|---|
committer | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-06 18:42:44 +0300 |
commit | cd27bead2e16586f9dcb1c9a467afce18f39fcb0 (patch) | |
tree | 613e689146f2b984f4ec86a5442887fd8ba74cd2 /app/views/shared | |
parent | 6accad69e214f44ac84f3ceac4159c712aa9af2e (diff) |
Cleanup css classes and styles
Use class and id syntax for button attributes
Use feature flag variable and shorthand if expression
Use shorthand if expression
Use a classname instead of tag
Simplify common rules
Use size variable
Move flex grow and shrink to utility classes
Extract redused classes
Remove unecessary styles
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/projects/_search_bar.html.haml | 9 | ||||
-rw-r--r-- | app/views/shared/projects/_sort_dropdown.html.haml | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml index 0620cd86db7..c1f2eaba284 100644 --- a/app/views/shared/projects/_search_bar.html.haml +++ b/app/views/shared/projects/_search_bar.html.haml @@ -1,12 +1,13 @@ - @sort ||= sort_value_latest_activity - project_tab_filter = local_assigns.fetch(:project_tab_filter, "") +- flex_grow_and_shrink_xs = 'd-flex flex-xs-grow-1 flex-xs-shrink-1 flex-grow-0 flex-shrink-0' .filtered-search-block.row-content-block.bt-0 .filtered-search-wrapper.d-flex.flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap - unless project_tab_filter == :starred - .filtered-search-nav.d-flex.mb-2.mb-lg-0 + .filtered-search-nav.mb-2.mb-lg-0{ class: flex_grow_and_shrink_xs } = render 'dashboard/projects/nav', project_tab_filter: project_tab_filter - .filtered-search.d-flex.w-100.mb-2.mb-lg-0{ class: project_tab_filter == :starred ? "extended-filtered-search-box ml-0 mb-2 mb-lg-0" : "ml-0 ml-sm-3" } + .filtered-search.d-flex.flex-grow-1.flex-shrink-1.w-100.mb-2.mb-lg-0.ml-0{ class: project_tab_filter == :starred ? "extended-filtered-search-box mb-2 mb-lg-0" : "ml-sm-3" } .btn-group.w-100{ role: "group" } .btn-group.w-100{ role: "group" } .filtered-search-box.m-0 @@ -14,12 +15,12 @@ = render 'shared/projects/search_form', admin_view: false, search_form_placeholder: _("Search projects...") %button.btn.btn-secondary{ type: 'submit', form: 'project-filter-form' } = sprite_icon('search', size: 16, css_class: 'search-icon ') - .filtered-search-dropdown.d-flex.flex-row.align-items-center.mb-2.m-sm-0#filtered-search-visibility-dropdown + .filtered-search-dropdown.flex-row.align-items-center.mb-2.m-sm-0#filtered-search-visibility-dropdown{ class: flex_grow_and_shrink_xs } .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold %span = _("Visibility") = render 'explore/projects/filter', has_label: true - .filtered-search-dropdown.d-flex.flex-row.align-items-center.m-sm-0#filtered-search-sorting-dropdown + .filtered-search-dropdown.flex-row.align-items-center.m-sm-0#filtered-search-sorting-dropdown{ class: flex_grow_and_shrink_xs } .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold %span = _("Sort by") diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml index 0bb2eb371dc..f5f940db189 100644 --- a/app/views/shared/projects/_sort_dropdown.html.haml +++ b/app/views/shared/projects/_sort_dropdown.html.haml @@ -3,7 +3,7 @@ .btn-group.w-100{ role: "group" } .btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" } - %button.dropdown-menu-toggle{ id: 'sort-projects-dropdown', type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } + %button#sort-projects-dropdown.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } = toggle_text = icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable |