- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.3k
feat(www): Spring cleaning episode 5 #12603
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
          
     Merged
      
      
            sidharthachatterjee
  merged 15 commits into
  master
from
topics/www-spring-cleaning-episode-5
  
      
      
   
  Mar 20, 2019 
      
    
                
     Merged
            
            feat(www): Spring cleaning episode 5 #12603
                    sidharthachatterjee
  merged 15 commits into
  master
from
topics/www-spring-cleaning-episode-5
  
      
      
   
  Mar 20, 2019 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    Attention, noooooooooob Friday stuff … potential public humiliation stuff 😅🥳
Since we want to define `presets.space` in relation to Typography.js’ `rhythm`, but doing so directly in `presets`  would have introduced a circular dependency among `utils/presets` and `utils/typography` (from what _I_ think I understand 🤓), up to now we had to put values from `presets.space` through `rhythm` for each usage in components:
```
import { space } from "../../utils/presets"
import { rhythm } from "../../utils/typography"
padding: ${rhythm(space[7])} ${rhythm(space[4])} ${rhythm(space[4])};
```
This caused a lot of unnecessary noise, and was an ugly derivation from the norm for that one group of design tokens in `presets` … and of course smells a lot.
This PR cleans that up — as good as I can.
I would appreciate any input and I’m happy to adjust this, crossing fingers that this PR at least shows where I want things to go:
```
import { space } from "../../utils/presets"
padding: ${space[7]} ${space[4]} ${space[4]};
```
- minimize direct usage of Typography.js’ `scale` and `rhythm`
- maximize usage of `presets` tokens for consistency, and make that easy and as concise as possible
—
- split up design tokens in `utils/presets` and move them to `utils/tokens/*` — theme-style FTW?!
- move `utils/colors` to `utils/tokens/colors`
- refactor to remove circular dependency among `utils/typography` and `utils.presets` — this enables us to use Typography.js’ `rhythm` in `utils.presets` so we can avoid manual „composition“ of `scale` values in components
- move `paddingLeft` helper function used in `components/sidebar/accordion` and `components/sidebar/section-title` to `utils/sidebar/indention`
    … instead of `typography.options` and `join(`,`) Move font stack definitions to tokens.
Lowercase is (subjectively) more legible and friendly, takes less space, matches the mobile navigation items, and magically resolves space issues on screens below „lg“
- move padding to anchor/title — allow - calmer „Expand/Collapse All“ button - increase sidebar „utility“ height (containing the „Expand/Collapse All“ button) height/whitespace - move a couple sidebar variables to `utils/sidebars/presets`, enables configuration of a couple of things: - sidebar item hover background color - sidebar item borders — I decided to drop those for now, can be brought back via changing a color variable - minimum item height - active „section item“ background - sidebar background color for offscreen/small screens, and persistent/larger screens - adjust `colors.ui` - drop `colors.ui.border` - freshen up `light`, `bright`, and `whisper` - bump default sidebar width - simplify „stepsUI“ (used for anchor links in „Tutorial“) — remove dashed lines - reduce sidebar active item font weight — dial it back to 600, which should be supported by the majority of the system font stack - improved distinction among top-level sections (via border-bottom and vertical whitespace) - sidebar expand/collapse chevron button now covers 100% of the item's height
…der bottom if there’s only one accordion
| Good to go!  | 
              
                    sidharthachatterjee
  
              
              approved these changes
              
                  
                    Mar 20, 2019 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in 🙌
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Attention, noooooooooob Friday stuff … potential public humiliation stuff 😅🥳
Since we want to define
presets.spacein relation to Typography.js’rhythm/baseLineHeight, but doing so directly inpresetswould have introduced a circular dependency amongutils/presetsandutils/typography(from what I think I understand 🤓), up to now we had to put values frompresets.spacethroughrhythmfor each usage in components:This caused a lot of unnecessary noise, and was an ugly derivation from the norm for that one group of design tokens in
presets… and AFAICT smells a lot.This PR cleans that up — as good as I can. I would appreciate any input and am happy to adjust this, crossing fingers that this PR at least shows where I want things to go:
TL; DR:
scaleandrhythmpresetstokens for consistency, and make that easy and as concise as possible—
What's in the bag:
utils/presetsand move them toutils/tokens/*— theme-style FTW?!utils/colorstoutils/tokens/colorsutils/typographyandutils.presets— this enables us to use Typography.js’rhythminutils.presetsso we can avoid manual „composition“ ofspacevalues in componentspaddingLefthelper function used incomponents/sidebar/accordionandcomponents/sidebar/section-titletoutils/sidebar/indentionspacedesign tokens instead of Typography.js'rhythmpresets.fontsin components instead oftypography.optionsandjoin(,`)utils/sidebars/presets, enables configuration of a couple of things:colors.uicolors.ui.borderlight,bright, andwhisper