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

feat: Responsive position utils #990

Merged
merged 1 commit into from
May 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions stylus/utilities/position.styl
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
@require '../settings/breakpoints'
@require '../tools/mixins'
/*------------------------------------*\
Position utilities
\*------------------------------------*/

$position-absolute
position-absolute()
position absolute

$position-relative
position-relative()
position relative

$position-fixed
position-fixed()
position fixed

$position-sticky
position-sticky()
position sticky

$position-static
position-static()
position static

// Global classes
global('.u-pos-absolute', $position-absolute)
global('.u-pos-relative', $position-relative)
global('.u-pos-fixed', $position-fixed)
global('.u-pos-sticky', $position-sticky)
global('.u-pos-static', $position-static)
props = {
'position-absolute': 'pos-absolute',
'position-relative': 'pos-relative',
'position-fixed': 'pos-fixed',
'position-sticky': 'pos-sticky',
'position-static': 'pos-static',
}

if cssmodules == true
cssModulesUtils(props, breakpoints)
else
nativeUtils(props, breakpoints)