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

Custom sidebar width & content width for all schemes. #339

Merged
merged 47 commits into from
Jul 4, 2018
Merged

Conversation

ivan-nginx
Copy link
Member

@ivan-nginx ivan-nginx commented Jul 4, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue Number(s): #150, #184
Pull Number(s): #111, #103

What is the new behavior?

  1. [BR]: Removed max_content_width setting (which was only for Gemini scheme).
  2. [BR]: renamed sidebar_width to sidebar.width option (moved from global to section to section under sidebar).
  3. Added desktop-largest() condition and setted to >1600px. Old desktop-large() now redefined to >1200px. Added new $content-desktop-largest variable.
  4. Replaced $main-desktop & $main-desktop-large variables with standard $content-desktop & $content-desktop-large for Pisces/Gemini schemes.
  5. Moved $sidebar-desktop variable from global base.styl variables file to Pisces.styl (because it's only for Pisces/Gemini).
  6. Moved layout global styles variables from Gemini.styl to Pisces.styl.

How to use?

Change sidebar width

In NexT _config.yml:

-# Manual define the max content width 
-# !!Only available for Gemini Scheme currently 
-# Leave it empty for the default 75% (suggest not less than 1000px) 
-#max_content_width: 1000px 
 
-# Manual define the sidebar width 
-# !!Only available for Gemini Scheme currently 
-# Leave it empty for the default 240 
-sidebar_width: 
sidebar:
  # Manual define the sidebar width. 
  # If commented, will be default for: 
  # Muse | Mist: 320 
  # Pisces | Gemini: 240 
  width: 300 

Change content width

By default, Pisces and Gemini schemes adapted under high-screen resolutions.
Muse and Mist have old 900px value with >=1600px desktop.
You can change variables in source/css/_variables/custom.styl:

$content-desktop         = XXX
$content-desktop-large   = XXX
$content-desktop-largest = XXX

For example, for Muse / Mist under high-screen resolutions:

$content-desktop         = 90%
$content-desktop-large   = 90%
$content-desktop-largest = 90%

OR

$content-desktop         = 50em
$content-desktop-large   = 55em
$content-desktop-largest = 60em

P.S. Docs will be ASAP in site. Please, be patient and wait.

Does this PR introduce a breaking change?

  • Yes.
  • No.

1. Added alias `alert` to `note` tag.
1. Added Codacy badge.
2. Added Feedback section.
3. Main status badges are centered from now.
1. [BR]: Removed `max_content_width` setting (which was only for Gemini scheme).
2. [BR]: renamed `sidebar_width` to `sidebar.width` option (moved from global to section to section under `sidebar`).
3. Added `desktop-largest()` condition and setted to >1600px. Old `desktop-large()` now redefined to >1200px. Added new `$content-desktop-largest` variable.
4. Replaced `$main-desktop` & `$main-desktop-large` variables with standard `$content-desktop` & `$content-desktop-large` for Pisces/Gemini schemes.
5. Moved `$sidebar-desktop` variable from global `base.styl` variables file to `Pisces.styl` (because it's only for Pisces/Gemini).
6. Moved layout global styles variables from `Gemini.styl` to `Pisces.styl`.
@ivan-nginx ivan-nginx mentioned this pull request Jul 4, 2018
3 tasks
@ivan-nginx ivan-nginx changed the title Dev Custom sidebar width & content width for all schemes. Jul 4, 2018
@ivan-nginx ivan-nginx added this to the v6.4.0 milestone Jul 4, 2018
@ivan-nginx ivan-nginx mentioned this pull request Jul 4, 2018
72 tasks
@ivan-nginx ivan-nginx merged commit b378211 into master Jul 4, 2018
@ivan-nginx ivan-nginx deleted the dev branch July 4, 2018 18:02
@jiangtj
Copy link
Member

jiangtj commented Aug 20, 2018

Old config max_content_width is set max-width property, but new variables is set width property in different resolution.
For me, max_content_width is performed well. And redo with below config

variables.styl
$content-desktop         = 75%
$content-desktop-large   = 75%
$content-desktop-largest = 75%

styles.styl
.header-inner {
  max-width: 1000px
}
.main-inner {
  max-width: 1000px
}
.footer-inner{
  max-width: 1000px
}
.header {
  max-width: 1000px
}

This is a little hard.

Jona-lee pushed a commit to Jona-lee/hexo-theme-next that referenced this pull request Oct 10, 2018
* Custom sidebar width & content width for all schemes.

1. [BR]: Removed `max_content_width` setting (which was only for Gemini scheme).
2. [BR]: renamed `sidebar_width` to `sidebar.width` option (moved from global to section to section under `sidebar`).
3. Added `desktop-largest()` condition and setted to >1600px. Old `desktop-large()` now redefined to >1200px. Added new `$content-desktop-largest` variable.
4. Replaced `$main-desktop` & `$main-desktop-large` variables with standard `$content-desktop` & `$content-desktop-large` for Pisces/Gemini schemes.
5. Moved `$sidebar-desktop` variable from global `base.styl` variables file to `Pisces.styl` (because it's only for Pisces/Gemini).
6. Moved layout global styles variables from `Gemini.styl` to `Pisces.styl`.
@jiangtj jiangtj mentioned this pull request Nov 8, 2018
11 tasks
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* Custom sidebar width & content width for all schemes.

1. [BR]: Removed `max_content_width` setting (which was only for Gemini scheme).
2. [BR]: renamed `sidebar_width` to `sidebar.width` option (moved from global to section to section under `sidebar`).
3. Added `desktop-largest()` condition and setted to >1600px. Old `desktop-large()` now redefined to >1200px. Added new `$content-desktop-largest` variable.
4. Replaced `$main-desktop` & `$main-desktop-large` variables with standard `$content-desktop` & `$content-desktop-large` for Pisces/Gemini schemes.
5. Moved `$sidebar-desktop` variable from global `base.styl` variables file to `Pisces.styl` (because it's only for Pisces/Gemini).
6. Moved layout global styles variables from `Gemini.styl` to `Pisces.styl`.
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.

2 participants