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 button to toggle the optional theme when viewing the docs #13463

Merged
merged 5 commits into from
May 23, 2014

Conversation

cvrebert
Copy link
Collaborator

Fixes #9764.
The button is only present on relevant pages of the docs. I didn't notice any undesirable effects on docs-specific styling.
/cc @twbs/team for review.

@cvrebert cvrebert added this to the v3.2.0 milestone Apr 29, 2014
@XhmikosR
Copy link
Member

I'm not sure the button's placement is right there. I mean, I don't think a lot of people do actually scoll to the bottom of the /css and /components pages.

@cvrebert
Copy link
Collaborator Author

@XhmikosR It's position: fixed ...

@XhmikosR
Copy link
Member

Indeed... I missed it because the button is covered by the browser info when loading stuff. Maybe right would be better?

@cvrebert
Copy link
Collaborator Author

Didn't want to risk interfering with the side nav, but I don't really care about the exact placement myself. Willing to change it to whatever is desired.

@XhmikosR
Copy link
Member

Maybe just merge it as it is then and we can change it later if needed.

@mdo: thoughts?

@@ -15,6 +15,10 @@

<!-- Bootstrap core CSS -->
<link href="../dist/css/bootstrap.min.css" rel="stylesheet">
{% if page.slug == "css" or page.slug == "components" or page.slug == "js" %}
<!-- Optional Bootstrap Theme -->
<link href="data:text/css;charset=utf-8," data-href="../dist/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">
Copy link
Member

Choose a reason for hiding this comment

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

BTW @cvrebert is this right? I mean is the href="data:text/css;charset=utf-8," part needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the <link> has to have an href for our HTML to validate.

Copy link
Member

Choose a reason for hiding this comment

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

I thought so too. But why do we need data-href too? I mean, we should be able to change href just fine, shouldn't we?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, but we need to put the actual URL to the theme CSS somewhere in our code (so that we can then put it into or take it out of the href). This way (data-href) seemed cleaner than hardcoding the URL into the JavaScript.

@XhmikosR
Copy link
Member

When have some time @cvrebert can you rebase this? Also ping @mdo for feedback :)

From my side, it looks good and we can always change the button's place later if people prefer it to be on the right bottom.

Conflicts:
	docs/assets/css/docs.min.css
@cvrebert
Copy link
Collaborator Author

@mdo So, any feedback on the button placement, styling, or phrasing?

@mdo
Copy link
Member

mdo commented May 22, 2014

Yeah I'll be taking a crack at this shortly. Have some local changes to tweak it. I'm hesitant to do a button in the bottom left, so I might just make this a link below the right subnav. Not ideal, but neither is the floating button. We can always improve this later, too.

@cvrebert cvrebert removed their assignment May 22, 2014
mdo added 2 commits May 22, 2014 18:38
Conflicts:
	dist/css/bootstrap.css.map
	dist/css/bootstrap.min.css
	docs/assets/css/docs.min.css
	docs/dist/css/bootstrap.css.map
	docs/dist/css/bootstrap.min.css
mdo added a commit that referenced this pull request May 23, 2014
add button to toggle the optional theme when viewing the docs
@mdo mdo merged commit 68de4bf into master May 23, 2014
@mdo mdo deleted the docs-theme-toggler branch May 23, 2014 02:20
@mdo mdo mentioned this pull request May 23, 2014
@cvrebert
Copy link
Collaborator Author

<3

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

Successfully merging this pull request may close these issues.

Add ability to view the docs with the v2 theme applied
3 participants