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

Add bootstrap v4.0.0-alpha.2 into the admin #955

Merged
merged 20 commits into from
Mar 8, 2016

Conversation

jhawthorn
Copy link
Contributor

The goal of this is to get bootstrap included into the admin with minimal changes. After this is merged we can begin replacing components as we see fit.

Rather than including the bootstrap-sass gem, I have simply added the scss into vendor/bundle. This is to avoid tying the version of bootstrap we use in the admin with the version stores use in their frontend, and is how we should be handing all admin assets from now on.

After including bootstrap, the only major issue I noticed was broken pagination. Rather than fighting with the bootstrap classes, I chose to remove our pagination component in favour of the one included with bootstrap. So the styles of that have changed (and probably need their colours fixed).

Issues:

  • <th> is now left aligned instead of centered
  • Button alignment is slightly off
  • Match pagination colour with rest of theme
  • Links should not have an underline
  • Add js files
  • Size of header has changed
  • <legend>s at the top of fieldsets have lost their line separator
  • margins on existing grids are slightly off

@graygilmore
Copy link
Contributor

The small misalignment of things everywhere is a no-go to me. I'd prefer to see us importing things one component at a time. What was your thought on that?

@cbrunsdon cbrunsdon mentioned this pull request Mar 3, 2016
@jhawthorn
Copy link
Contributor Author

The small misalignment of things everywhere is a no-go to me. I'd prefer to see us importing things one component at a time. What was your thought on that?

We spoke IRL, most of our misalignments are going to be due to bootstrap's reboot and typography, and it isn't much use to include bootstrap without those. I'm going to try to fix up as many issues as possible before merging and have created a checklist of issues.

bootstrap4 styles. If you have a custom admin page with pagination you can
use this style with the following.

<%= paginate @collection, theme: "admin" %>
Copy link
Member

Choose a reason for hiding this comment

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

This theme should be called solidus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I went with "solidus_admin"

@jhawthorn
Copy link
Contributor Author

I think this is good to go 🚢

I spent a while browsing through the admin and can no longer find anything noticeably broken. Spacing has of course changed slightly in a few places, but nothing I've found looks out of place.

@tvdeyen tvdeyen mentioned this pull request Mar 5, 2016
5 tasks
jhawthorn added 18 commits March 7, 2016 10:30
Previous to the addition of bootstrap, our :before and :after
pseudo-elements were not box-sizing: border-box, which their spacing
depended on.

This adds padding: 0 to the no-text versions of the icons, which removed
the right padding that is needed for the icons when combined with a
button.
Previously we included just this one scss file from bootstrap to do our
media components.
Previously there were some minor layout issues due to both grids
claiming ownership of the "container" and "row" classes. Skeleton sets
container to a fixed width 960px, where bootstrap by default uses a
max-width of 940px. Bootstrap also provides styles for "row", as part of
its grid system.

This disables the generation of grid classes in bootstrap to avoid the
mixed styling of "row". To make use of the bootstrap grids we will be
using mixins.

This changes the max-size of the container in bootstrap to 960px, so
that containers use the existing size defined by skeleton.
Also adds tether.js, which is required by bootstrap's js.
@jhawthorn
Copy link
Contributor Author

I replaced the a-la-carte individual JS files with the single bootstrap.js file. It was pointed out to me that it would be nice for extension developers to have the entire suite of bootstrap js components available. This is also a lot simpler to include anyways.

This is a more modern approach to grids, which we can use because we
require modern browsers in the admin.
@tvdeyen
Copy link
Member

tvdeyen commented Mar 7, 2016

Why not just deliver the files, but not require them. Then we could have a slim JS file for "default" Solidus and extension developers are still able to require components they need.

For instance, the Tab component won't be used by default Solidus admin, so why require it and bloat the JS file?

Also, I thought we agreed on porting one component at a time, so we basically don't need any JS component right know?

Am I missing something? /c @graygilmore

@jhawthorn
Copy link
Contributor Author

I prefer including the entire bootstrap.js file. I suspect it will be a point of confusion for users if some bootstrap features don't work (the bootstrap docs aren't as clear as they could be about needing to include js for the data-toggle features).

IMO if we were going to sweat a couple extra KB, we wouldn't be using bootstrap in the first place.

@tvdeyen
Copy link
Member

tvdeyen commented Mar 8, 2016

As discussed in slack we go with the whole file

👍 :shipit: already!

tvdeyen pushed a commit that referenced this pull request Mar 8, 2016
Add bootstrap v4.0.0-alpha.2 into the admin
@tvdeyen tvdeyen merged commit 8786e18 into solidusio:master Mar 8, 2016
@tvdeyen
Copy link
Member

tvdeyen commented Mar 8, 2016

YOLO!

@jhawthorn jhawthorn deleted the admin_bootstrap4 branch March 8, 2016 23:10
@forkata
Copy link
Contributor

forkata commented Mar 9, 2016

Thanks @jhawthorn didn't get a chance to chime in before this got merged but 👍 great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants