Skip to content

Customizing bootstrap #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions app/assets/stylesheets/_bootstrap-custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*
* This file lists all the available Bootstrap modules, uncomment
* the modules you want to import
*/

// Core variables and mixins
@import "bootstrap-overrides";
@import "bootstrap/variables";
@import "bootstrap/mixins";

// Reset and dependencies
@import "bootstrap/normalize";
@import "bootstrap/print";
@import "bootstrap/glyphicons";

// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";

// Components
@import "bootstrap/component-animations";
@import "bootstrap/dropdowns";
@import "bootstrap/button-groups";
@import "bootstrap/input-groups";
@import "bootstrap/navs";
@import "bootstrap/navbar";
// @import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
@import "bootstrap/labels";
@import "bootstrap/badges";
// @import "bootstrap/jumbotron";
// @import "bootstrap/thumbnails";
@import "bootstrap/alerts";
// @import "bootstrap/progress-bars";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/panels";
@import "bootstrap/responsive-embed";
// @import "bootstrap/wells";
@import "bootstrap/close";

// Components w/ JavaScript
@import "bootstrap/modals";
@import "bootstrap/tooltip";
// @import "bootstrap/popovers";
// @import "bootstrap/carousel";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simply remove the commented out ones, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left those comments because it could help future contributors understand that we are not loading all the modules. It's kind of an explicit way of saying which Bootstrap parts are not being used.

Copy link
Collaborator

@sauloperez sauloperez May 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO that could be a bit more clear if precede it with a comment block explaining just that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";
9 changes: 9 additions & 0 deletions app/assets/stylesheets/_bootstrap-overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$brand-primary: $palette-turkey;

$navbar-inverse-brand-hover-color: $palette-light-blue;
$navbar-inverse-brand-color: $white;

$navbar-inverse-link-color: $white;
$navbar-inverse-link-active-color: $palette-light-blue;
$navbar-inverse-link-active-bg: $palette-turkey;
$navbar-inverse-link-hover-color: $palette-light-blue;
27 changes: 27 additions & 0 deletions app/assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// New palette
$palette-turkey: #2797af;
$palette-dark-turkey: #165e6d;
$palette-light-blue: #d9edf7;

// Old colors
$bg-color: #f5f8fa;
$white: #ffffff;
$border: #e1e8ed;
$menu-disabled: #ddd;
$black: #000;
$form-input-glyph: #555;
$form-input-bg-color: #f5f5f5;
$form-input-button: #2a292a;
$form-input-button-hover: #3a393a;
$form-a-color: gray;
$form-a-hover-color: #333;
$form-login-gray-text: #9b9b9b;
$btn-landing: rgba(255, 255, 255, 0.7);
$btn-landing-hover: rgba(255, 255, 255, 0.9);
$pages-title: #4a4a4a;
$pages-text: #4a4a4a;
$pages-anchor: #4a4a4a;
$pages-anchor-hover: #8a8a8a;
$features-background: #f5f5f5;
$features-separator: #d8d8d8;

50 changes: 7 additions & 43 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,9 @@
*= require_self
*/

@import "variables";
@import "bootstrap-sprockets";
@import "bootstrap";

$bg-color: #f5f8fa;
$navs-bg-color: #1e1e1e;
$white: #ffffff;
$border: #e1e8ed;
$navs-hover-color: #aaa;
$menu-drop: #333;
$menu-drop-hover: #333;
$menu-disabled: #ddd;
$black: #000;
$form-input-glyph: #555;
$form-input-bg-color: #f5f5f5;
$form-input-button: #2a292a;
$form-input-button-hover: #3a393a;
$form-a-color: gray;
$form-a-hover-color: #333;
$form-login-gray-text: #9b9b9b;
$btn-landing: rgba(255, 255, 255, 0.7);
$btn-landing-hover: rgba(255, 255, 255, 0.9);
$pages-title: #4a4a4a;
$pages-text: #4a4a4a;
$pages-anchor: #4a4a4a;
$pages-anchor-hover: #8a8a8a;
$features-background: #f5f5f5;
$features-separator: #d8d8d8;
@import "bootstrap-custom";

html {
font-size:62.5%;
Expand Down Expand Up @@ -442,25 +418,13 @@ form .checkbox input[type="checkbox"] {
}

.navbar-static-top {
background-color: $navs-bg-color;
background-color: $palette-turkey;
}

.navbar-inverse {
border: 0;
}

.navbar-inverse .navbar-brand {
color: $white;
}

.navbar-inverse .navbar-nav > li > a {
color: $white;
}

.navbar-inverse .navbar-brand a:hover, .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus {
color: $navs-hover-color;
}

.navbar-brand {
font-size: 2.4rem;
font-weight: 600;
Expand Down Expand Up @@ -510,7 +474,7 @@ form .checkbox input[type="checkbox"] {
}
}
.dropdown-menu{
background: $navs-bg-color;
background: $palette-turkey;
border: 0.2rem solid $white;
border-top: 0;
border-top-left-radius: 0;
Expand All @@ -525,7 +489,7 @@ form .checkbox input[type="checkbox"] {
font-weight: 500;
padding: 0.6rem 1.2rem;
&:hover{
background: $menu-drop-hover;
background: $palette-dark-turkey;
opacity: 0.8;
}
&:focus,
Expand Down Expand Up @@ -578,7 +542,7 @@ form .checkbox input[type="checkbox"] {

.landing-page {
background: image-url('home_back.jpg') no-repeat center center fixed;
background-color: $navs-bg-color;
background-color: $palette-turkey;
background-size: cover;
text-align: center;

Expand Down Expand Up @@ -916,4 +880,4 @@ form .checkbox input[type="checkbox"] {
padding: 1em;
line-height: 1.6em;
}
}
}
4 changes: 2 additions & 2 deletions app/views/application/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<%= render 'application/menus/user_list_link' %>
<%= render 'application/menus/offers_dashboard_link' %>
<%= render 'application/menus/inquiries_list_link' %>
<%= render 'application/menus/offers_by_tag_link' %>
<% if current_user.manages? current_organization %>
<%= render 'application/menus/offers_by_tag_link' %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this now only for admins?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @mllocs

cc/ @sseerrggii

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the last redesign conversations we had it was proposed to remove this section (to simplify the interface). Instead, I'm making it available only for admins.

<%= render 'application/menus/organization_reports_menu' %>
<%= render 'application/menus/organization_statistics_menu' %>
<%= render 'application/menus/organization_listings_menu' %>
Expand All @@ -63,4 +63,4 @@
</div>
</div>
</nav>
<% end %>
<% end %>