Skip to content
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

Upgrade to Bootstrap 4.0.0.alpha6 #1816

Merged
merged 13 commits into from
Apr 5, 2017

Conversation

jhawthorn
Copy link
Contributor

Previously we were on Bootstrap 4.0.0.alpha2. Changes can be seen in their Release notes

Notable to us:

  • col-xs-3 et al. are gone. Replaced with col-3.
  • Flexbox is on by default 👍 (we had already turned on the optional flexbox support)
  • Classes for breadcrumbs changed (easy fix)
  • Some variables and mixins changed

I can't be 100% sure this didn't mess up any styling, but in a quick browse through the admin I didn't spot anything off.

Previously normalize.css set table's border-spacing to 0, bootstrap now
uses reboot.css, which doesn't reset this property.
Bootstrap has removed col-xs-N in the latest alphas.
This works around a bootstrap 4.0.0.alpha6 issue resulting in

    Error: Tooltip is transitioning

We should be able to re-enable this for the next release if desired.
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Found some stuff, that's partially related to these changes, but should be tackled in this PR IMO.

Feel free to grab from https://github.com/tvdeyen/solidus/commits/bootstrap-4-a6-review where you see fit.


// Forms

$input-padding-x: .75rem !default;
$input-padding-y: .375rem !default;
$input-padding-y: .5rem !default;
$input-line-height: 1.25 !default;
Copy link
Member

Choose a reason for hiding this comment

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

We need to add the newly introduced $input-line-height variable into our custom form fields, otherwise the inputs are too high in contrast to the selects

Before

monosnap 2017-04-04 10-38-05

After

monosnap 2017-04-04 10-40-50

input[type="text"], ... {
  ...
  font-size: $font-size-base;
  line-height: $input-line-height;
  ...
}

@@ -2,7 +2,7 @@
<fieldset class="no-border-bottom">
<legend align="center"><%= Spree.t(:add_product) %></legend>

<div class="col-xs-9">
<div class="col-9">
Copy link
Member

Choose a reason for hiding this comment

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

I think this wrapper should be removed altogether. I know this is not part of this PR, but with the removal of the xs column classes this gets more obvious then before.

Before

shipments - r987654321 - orders 2017-04-04 10-45-46

After

shipments - r987654321 - orders 2017-04-04 10-48-16

@@ -2,7 +2,7 @@
<fieldset class="no-border-bottom">
<legend align="center"><%= Spree.t(:add_product) %></legend>

<div class="col-xs-9">
<div class="col-9">
<div data-hook="add_product_name" class="field">
<%= label_tag :add_line_item_variant_id, Spree.t(:name_or_sku) %>
<%= text_field_tag :add_line_item_variant_id, "", class: "variant_autocomplete fullwidth" %>
Copy link
Member

Choose a reason for hiding this comment

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

Out of scope, but I couldn't find any reference to this partial. 🤔

.media-list {
padding-left: 0;
list-style: none;
.media-body {
Copy link
Member

Choose a reason for hiding this comment

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

Flexbox 💪

Changes to this file visually breaks the variant select in both Chrome and Firefox.

Adding

.media-left {
  padding: .5rem .5rem 0 0;
}

fixed this for me.

Before

monosnap 2017-04-04 11-02-18

After

monosnap 2017-04-04 11-07-44

Copy link
Contributor Author

@jhawthorn jhawthorn Apr 4, 2017

Choose a reason for hiding this comment

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

Right. I forgot this.

Bootstrap removed the .media-left class https://v4-alpha.getbootstrap.com/layout/media-object/ instead asking you to just specify .mr-3.

👍 Your padding solution is a good fix.

@@ -50,7 +50,7 @@
<tr class="edit-method hidden total">
<td colspan="5">
<div class="row">
<div class="col-xs-4">
<div class="col-4">
Copy link
Member

Choose a reason for hiding this comment

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

I'm not quite sure why this start to break visually now, but this makes the select too small. We should change this to col-12. We could also remove the row and col completely as I don't see any advantage to have this in this form, but this could break potential Deface overrides stores could have made.

Before

monosnap 2017-04-04 11-14-33

After

monosnap 2017-04-04 11-19-50

@@ -49,7 +49,7 @@
}
Copy link
Member

Choose a reason for hiding this comment

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

Probably not caused by any change made in this PR I guess, but poking around I stumbled over a wrong background colour on disabled select dropdown arrows.

Before

monosnap 2017-04-04 11-35-18

.select2-arrow {
  ...
  b {
    background: transparent ...;
    ...
  }
}

I would even prefer to only make the background-image !important, but to keep the changeset as small as possible I just changed the background color

After

monosnap 2017-04-04 11-44-46

@@ -1,5 +1,10 @@
// Base
//--------------------------------------------------------------

html {
font-size: $font-size-root;
Copy link
Member

Choose a reason for hiding this comment

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

Bootstrap removed this for accessibility reasons twbs/bootstrap@bd38a2a

We should follow their example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like that, but I think we should do this in a separate PR. Removing this would move us from 13px to 16px (maybe), which is a really significant change, which I'm sure will cause some issues. I'd rather we look at that separately.

Copy link
Member

Choose a reason for hiding this comment

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

As long as we set $font-size-base to $body-font-size everything should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That changes the size of our rem, which I don't want to do. It's awkward that our base font size doesn't match a rem, making rem pretty useless if it doesn't match up with anything else on the page. If we're setting $font-size-base to a px value anyways we're not improving accessibility in any way.

I appreciate the argument that using the browser's default font size is a good thing. But if we aren't (and I think it's too big a change for this PR) the way bootstrap used to do it, and the way we're doing it here, by setting a size on the root element, is best.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed!

@@ -1,6 +1,6 @@
<div data-hook="admin_named_type_form_fields" class="row">
<div class="row">
Copy link
Member

Choose a reason for hiding this comment

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

These nested rows now break the layout

We should remove the nested row and change the columns size back to 4 as this is the value it was in our skeleton based UI.

Before

different from description - rma reasons - refunds and returns - settings 2017-04-04 13-39-42

After

different from description - rma reasons - refunds and returns - settings 2017-04-04 13-43-23

@jhawthorn
Copy link
Contributor Author

@tvdeyen I've pulled in your changes other than changing the font size.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

🚢

@jhawthorn jhawthorn merged commit f6b660d into solidusio:master Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants