Commit 1a732281 authored by Simon Knox's avatar Simon Knox Committed by Paul Slaughter

Add some classes conditionally rather than using extend

This shrinks application.css from 2.4MB to 2.3
Using @extend with buttons meant there were 800 instances of
stat-text in the stylesheet, rather than just using the button
classes in haml.

I am not even sure under what circumstances the stat-text is
rendered, I tested it by hardcoding link_to_if to false
parent 0f5e9c57
......@@ -794,11 +794,6 @@
}
.project-buttons {
.stat-text {
@extend .btn;
@extend .btn-default;
}
.nav > li:not(:last-child) {
margin-right: $gl-padding-8;
}
......
......@@ -14,7 +14,7 @@
- if is_project_overview
.project-buttons.gl-mb-3.js-show-on-project-root
= render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout)
= render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true
#js-tree-list{ data: vue_file_list_data(project, ref) }
- if can_edit_tree?
......
- anchors = local_assigns.fetch(:anchors, [])
- project_buttons = local_assigns.fetch(:project_buttons, false)
- return unless anchors.any?
%ul.nav
- anchors.each do |anchor|
%li.nav-item
= link_to_if anchor.link, anchor.label, anchor.link, class: anchor.is_link ? 'nav-link stat-link d-flex align-items-center' : "nav-link btn btn-#{anchor.class_modifier || 'missing'} d-flex align-items-center" do
.stat-text.d-flex.align-items-center= anchor.label
.stat-text.d-flex.align-items-center{ class: ('btn btn-default' if project_buttons) }= anchor.label
......@@ -20,7 +20,7 @@
.project-clone-holder.d-none.d-md-inline-block.mt-2.mr-2.float-left
= render "projects/buttons/clone"
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons, project_buttons: true
- if can?(current_user, :push_code, @project)
.empty-wrapper.gl-mt-7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment