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

v5 Docs followup #29048

Closed
wants to merge 25 commits into from
Closed

v5 Docs followup #29048

wants to merge 25 commits into from

Conversation

mdo
Copy link
Member

@mdo mdo commented Jul 15, 2019

With #28450 (major forms rewrite) I changed the designed of the docs to get back to how we used to build this thing in v3 and earlier. v4's docs have always felt like a web app to me instead of an documentation site. Three columns of content, most of which stayed stickied was also a tad frustrating for me. More importantly though, I felt things were lacking polish, attention to detail, etc.

This PR will tackle the todos from @MartijnCuppens's comment and from @patrickhlauke's issue at #29047.

Changes

Here's some clarification and additional fixes (including todos) to follow-up:

  • Clarify and update padding changes to <ol> and <ul> in Reboot. I added padding-right originally by mistake thinking I needed to reset that, but really I only needed padding-left redone.
  • Add new Icons component to the migration docs (I created these myself to replace the Open Iconic ones we'd been using). More icons are planned to come, but for now it focuses on a handful for our components.
  • Clarify migration docs for the changes in apperance and behavior for form components (namely checks and files).
  • Add note to migration docs about table changes.
  • Fix remaining tables that were lacking .table.
  • Improve icons component docs with code snippets, design decisions, and usage guidelines.
  • Look into box-shadows support on icons with custom form controls
  • After Doc tweaks #29029 merges, add search form to the docs homepage
  • Consider moving sidebar icon to ::before per Doc tweaks #29029 (comment) Done in @XhmikosR's PR
  • Fix color contrast in navbar
  • Update icons one more time—add some new ones, rename the class from .booticon to .bi because it's shorter and comes with fewer jokes, and remove unused styles in docs CSS.
  • Make navbar, subnav, and sidebar work on mobile
  • Move the icons to includes
  • Move icons outside of content folder
  • Stop inlining the SVGs; we have http/2 so it should be pretty fast anyway
  • Verify if we need to add role or focusable="false"
  • Move the nav changes to a separate PR

Explaining some other decisions...

Tables

Tables saw a redesign to simplify their CSS and overall appearance. I also took the opportunity to remove several lines of custom docs CSS that re-applied the Bootstrap table styles to Markdown tables. Doing so meant rewriting the tables to allow explicit classes, which I was fine to do given we're inconsistent in our Markdown/HTML tables usage.

See https://github.com/twbs/bootstrap/pull/28450/files#diff-e923be674b22e7e32a5d742c5a05b3ae, c8d1a0e, and f9f9e45.

Larger form controls

This was intentional, and really only applies to the checks, radios, and switches. They're larger than the default and inconsistently styled ones each OS sees (macOS ones are quite small) and scale now to font-size or explicit dimension changes. I'll look into these not working in IE, but I thought my early tests in there showed no problems.

Icons

Still working on more here, but again, these are custom icons I've made to replace the ones we were using from external libraries. Goal is to have a toolkit focused set at launch to support our components. Maybe more icons can be added after that. In the future, this could be it's own project I suppose.

Docs design changes

While the intro to this PR covers much of it, the changes here are meant to simplify our docs and accelerate movement around the docs pages. The sidebar has been overhauled to always have all links available to each docs page vs only the ones in the group you're in (e.g., Components). Stylistically, I'm working to simplify the main navbar for usability and improve the page content design with fewer custom styles.

Preview: https://deploy-preview-29048--twbs-bootstrap.netlify.com/


@twbs/css-review Keep the questions and feedback coming.

@XhmikosR XhmikosR force-pushed the docs-followup branch 2 times, most recently from cf050a8 to 1813707 Compare July 17, 2019 15:53
@XhmikosR
Copy link
Member

@mdo how about moving all icons to a new folder in partials? This way we could automate their optimization etc.

@mdo
Copy link
Member Author

mdo commented Jul 18, 2019

how about moving all icons to a new folder in partials? This way we could automate their optimization etc.

I'm unsure how we'll package these up just yet, but I am obvi in favor of scripts to automate optimization, property order, etc. I don't want them optimized for Hugo btw, but I do want them optimized for easy use in HTML.

@mdo
Copy link
Member Author

mdo commented Jul 19, 2019

@XhmikosR Just pushed up changes to add all the SVGs (sorry, I know it's the wrong directory) and embed them that way. I'm unsure how Hugo handles things I can loop over from a directory, so I need to revisit that. Any pointers would be great, I'd love to better understand how to use Hugo :). Additionally I'm hoping to add some scripts to handle the SVGs better.

@XhmikosR
Copy link
Member

I'm gonna rebase and clean the branch and see what I can do later.

@XhmikosR
Copy link
Member

Is the subnav supposed to be shown in the homepage and everywhere?

I will look into automating the icons inclusion later.

@XhmikosR
Copy link
Member

@mdo check out the last patch. Don't merge this yet, I really want to make sure the nav changes are OK this time. Ideally they should be split in a separate PR and the same for the iconic removal.

@XhmikosR
Copy link
Member

XhmikosR commented Jul 19, 2019

Also, the folder you have the icons currently copies the SVGs in the dist folder which I believe is redundant.

Also, maybe we shouldn't inline the icons? We have http/2 so it should be pretty fast anyway.

@XhmikosR
Copy link
Member

And I'm unsure if we should add focusable="false" or role="img"....

@XhmikosR
Copy link
Member

So, @mdo how about we split the nav changes to a separate PR and most importantly for this PR, move the icons folder somewhere outside of content?

@@ -10,6 +10,21 @@ toc: true

Meet the Bootstrap icons, a limited set of icons designed first and foremost to work with Bootstrap's components. From form controls to navigation, these icons are the perfect complement to our toolkit. They're SVGs, so they'll scale quickly and easily to any size, they can be easily recolored with CSS, and more. They're also included in Bootstrap under the MIT license.

<div class="bd-bi-grid d-flex flex-wrap mb-5">
Copy link
Member

Choose a reason for hiding this comment

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

Need to check if we can reuse the shortcode

{{- $filename := index $filenameWithExt 0 -}}
{{- $name := humanize $filename -}}
<div class="p-3 mr-2 mb-2 border rounded">
{{ readFile (printf "%s%s" $dirName .Name) }}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add tooltips with the class names?

This was referenced Jul 21, 2019
@mdo mdo closed this Jul 21, 2019
@mdo
Copy link
Member Author

mdo commented Jul 21, 2019

Split via cherry-pick to #29091 and #29092.

@mdo mdo deleted the docs-followup branch July 21, 2019 19:36
@XhmikosR XhmikosR mentioned this pull request Jul 21, 2019
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.

2 participants