-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New utilities & docs - fade out, hover grow, border white fade, responsive positioning, and circle #375
Merged
Merged
New utilities & docs - fade out, hover grow, border white fade, responsive positioning, and circle #375
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1c9fbfa
New reponsive layout/position utils
93170a2
Docs for responsive positioning
62f552c
border-white fade css
57075a2
border-white-fade docs
12bd248
hover grow css
c18b8d0
hover grow docs
aee1483
Add fade out css
3d47e86
Add fade out docs
2530d4c
Add circle class
17542a2
Add utilities and marketing utilities to storybook
4c713a9
Rename headings to fix storybook errors
abc2175
oops, put the ) in the right spot
cbae32d
fix border examples
c814e56
show more examples of positioning in docs
9060f34
include scss (might need that) & add margin to make example look better
8fec79d
Remove stories to stop things from being broken
c46fe01
Marketing utils story
7079001
Add more stories
c2f6984
incorporate @broccolini's feedback
dea33f2
add link to docs folder
broccolini d14f8f8
Merge branch 'new-marketing-utils' of https://github.com/primer/prime…
broccolini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Layout | ||
status: New release | ||
--- | ||
|
||
Marketing layout utilities build on top of [primer-core utilities](/layout/#position), adding the option of responsive positioning. | ||
|
||
{:toc} | ||
|
||
## Responsive position | ||
|
||
Use responsive position utilities to adjust the position of an element at different breakpoints. | ||
|
||
```html | ||
<div class="position-relative p-6 bg-gray"> | ||
<div class="d-inline-block position-md-absolute bottom-0 right-0 border bg-white p-2"> | ||
.position-md-absolute | ||
</div> | ||
</div> | ||
|
||
<div class="float-left border m-3" style="width:100px; height:100px;"> | ||
default | ||
</div> | ||
<div class="float-left position-lg-relative border m-3" style="width:100px; height:100px; top:12px; left:12px;"> | ||
.position-lg-relative | ||
</div> | ||
<div class="float-left border m-3" style="width:100px; height:100px;"> | ||
default | ||
</div> | ||
<div class="float-left border m-3" style="width:100px; height:100px;"> | ||
default | ||
</div> | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
// utilities | ||
@import "./lib/filters.scss"; | ||
@import "./lib/borders.scss"; | ||
@import "./lib/layout.scss"; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Layout utilities | ||
// stylelint-disable block-opening-brace-space-before, primer/selector-no-utility, comment-empty-line-before | ||
|
||
// Responsive position utilities | ||
|
||
@each $breakpoint in map-keys($breakpoints) { | ||
@include breakpoint($breakpoint) { | ||
/* Set position to relative */ | ||
.position-#{$breakpoint}-relative { position: relative !important; } | ||
/* Set position to absolute */ | ||
.position-#{$breakpoint}-absolute { position: absolute !important; } | ||
/* Set position to fixed */ | ||
.position-#{$breakpoint}-fixed { position: fixed !important; } | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
|
||
storiesOf('Marketing Utilities', module) | ||
.add('Responsive borders', () => ( | ||
<div className='border-top border-sm-right border-md-bottom border-lg-top-0'>.border-top-0</div> | ||
)) | ||
.add('border-white-fade', () => ( | ||
<div className='bg-blue text-white p-3'> | ||
<span className='border border-white-fade p-2'> | ||
.border-white-fade | ||
</span> | ||
</div> | ||
)) | ||
.add('Responsive position', () => ( | ||
<div className='position-relative p-6 bg-gray'> | ||
<div className='d-inline-block position-md-absolute bottom-0 right-0 border bg-white p-2'> | ||
.position-md-absolute | ||
</div> | ||
</div> | ||
)) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
|
||
storiesOf('Utilities', module) | ||
.add('hover-grow', () => ( | ||
<div className='Box hover-grow p-4'> | ||
.hover-grow | ||
</div> | ||
)) | ||
.add('circle', () => ( | ||
<div className='border circle p-3' style={{width: '100px', height: '100px'}}> | ||
.circle | ||
</div> | ||
)) |
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.
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.
Does this need to be changed to
Marketing border colors
to avoid dupes in stories?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.
I have these added manually to the story for now, using the class names. But they're under "marketing utilities" so I think it's pretty clear.