Skip to content

Instantly share code, notes, and snippets.

@vio
Created December 18, 2008 21:11
Show Gist options
  • Save vio/37662 to your computer and use it in GitHub Desktop.
Save vio/37662 to your computer and use it in GitHub Desktop.
// custom rounded corners box with 1px border
// figure images sizes = radius
!radius = 10px
!box_dir = default
!box_border = 1px
=rounded_corners
:margin 0 0 24px
:position relative
:padding = !radius 0
.inner
:padding 7px 16px
:border 1px solid #DDD
:border-width = 0 !box_border
:background
:color transparent
:image = url(../images/box/!box_dir/bg.png)
:repeat repeat-x
:position left top
:position relative
:z-index 2
// figures
!figure_size = !radius
span.lt, span.rt, span.lb, span.rb, span.t, span.b
+figure
:z-index 1
// corners
span.lt
:top 0px
:left 0px
:background-image = url(../images/box/!box_dir/lt.png)
span.rt
:top 0px
:right 0px
:background-image = url(../images/box/!box_dir/rt.png)
span.lb
// todo: ie fix
:bottom 0px
:left 0px
:background-image = url(../images/box/!box_dir/lb.png)
span.rb
// todo: ie fix
:bottom 0px
:right 0px
:background-image = url(../images/box/!box_dir/rb.png)
// top & bottom
span.t, span.b
:height = !radius - !box_border
:left = !radius
:right = !radius
:width auto
:background-repeat repeat-x
span.t
:border-top = !box_border solid #DDD
:top 0px
:background-image = url(../images/box/!box_dir/t.png)
span.b
:border-bottom = !box_border solid #DDD
:bottom 0px
:background-image = url(../images/box/!box_dir/b.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment