Skip to content

Commit

Permalink
Merge pull request #913 from CPatchane/position_utilities
Browse files Browse the repository at this point in the history
Add position utilities
  • Loading branch information
CPatchane authored Apr 23, 2019
2 parents bc1f730 + 27587e5 commit 6def4bb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stylus/cozy-ui/build.styl
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,27 @@ Display an chip that represents complex identity
Styleguide utilities.display
*/

/*
Position
Classes to change the position of an element
.u-pos-absolute - Absolute position
.u-pos-relative - Relative position
.u-pos-fixed - Fixed position (relative to the viewport)
.u-pos-sticky - Sticky position
.u-pos-static - Static position
Markup:
<div style="position: relative; margin: 1rem; padding: .125rem .25rem; background-color:gainsboro; border: 1px solid black;">
<div class="{{modifier_class}}" style="background-color:green;">Nulla ex aptent</div>
</div>
Weight: 1
Styleguide utilities.position
*/

/*
Flexbox display
Expand Down
26 changes: 26 additions & 0 deletions stylus/utilities/position.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@require '../tools/mixins'
/*------------------------------------*\
Position utilities
\*------------------------------------*/

$position-absolute
position absolute

$position-relative
position relative

$position-fixed
position fixed

$position-sticky
position sticky

$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)

0 comments on commit 6def4bb

Please sign in to comment.