diff --git a/doc-src/content/examples/compass/css3/background-origin.haml b/doc-src/content/examples/compass/css3/background-origin.haml new file mode 100644 index 00000000..602e5c00 --- /dev/null +++ b/doc-src/content/examples/compass/css3/background-origin.haml @@ -0,0 +1,8 @@ +--- +title: Background Origin +description: See background origin in action. +framework: compass +stylesheet: compass/css3/_background_origin.sass +example: true +--- += render "partials/example" diff --git a/doc-src/content/examples/compass/css3/background-origin/background.png b/doc-src/content/examples/compass/css3/background-origin/background.png new file mode 100644 index 00000000..020b4566 Binary files /dev/null and b/doc-src/content/examples/compass/css3/background-origin/background.png differ diff --git a/doc-src/content/examples/compass/css3/background-origin/markup.haml b/doc-src/content/examples/compass/css3/background-origin/markup.haml new file mode 100644 index 00000000..a10a7fa4 --- /dev/null +++ b/doc-src/content/examples/compass/css3/background-origin/markup.haml @@ -0,0 +1,7 @@ +.example + #padding-box(style="background-image: url(background/);") + Padding Box + #border-box(style="background-image: url(background/);") + Border Box + #content-box(style="background-image: url(background/);") + Content Box \ No newline at end of file diff --git a/doc-src/content/examples/compass/css3/background-origin/stylesheet.sass b/doc-src/content/examples/compass/css3/background-origin/stylesheet.sass new file mode 100644 index 00000000..4a78efa8 --- /dev/null +++ b/doc-src/content/examples/compass/css3/background-origin/stylesheet.sass @@ -0,0 +1,20 @@ +@import compass/css3 + +.example + padding: 2em + div + background: + repeat: repeat + position: top left + border: 10px solid rgba(255, 0, 0, 0.5) + color: white + +text-shadow(darken(#00f, 50%), 2px, 2px) + padding: 1em + text-align: center + margin-bottom: 2em + #padding-box + +background-origin("padding-box") + #border-box + +background-origin("border-box") + #content-box + +background-origin("content-box") \ No newline at end of file diff --git a/frameworks/compass/stylesheets/compass/css3/_background_origin.sass b/frameworks/compass/stylesheets/compass/css3/_background_origin.sass index f5588575..b2e9c438 100644 --- a/frameworks/compass/stylesheets/compass/css3/_background_origin.sass +++ b/frameworks/compass/stylesheets/compass/css3/_background_origin.sass @@ -1,13 +1,17 @@ // - Position the background off the edge of the padding, border or content - - * Possible values: [padding-box | border-box | content-box] - * browser defaults to padding-box, mixin defaults to content-box - - Override constants to change defaults. + Override `!default_background_origin` to change the default. !default_background_origin ||= "content-box" +// + Position the background off the edge of the padding, border or content + + * Possible values: + * `"padding-box"` + * `"border-box"` + * `"content-box"` + * browser defaults to `"padding-box"` + * mixin defaults to `"content-box"` =background-origin(!origin = !default_background_origin) // webkit and mozilla use the deprecated short [border | padding | content] !deprecated= "padding"