diff options
author | Derek Perez <pzd@google.com> | 2015-09-23 13:30:40 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2015-09-24 14:14:34 +0000 |
commit | 98235e3053b02ed1a8a48e43d8c3fde1ae57b5f6 (patch) | |
tree | 9c6b9f6a896551f770207bf37a986ba14bfa047e /examples | |
parent | faa0e4a024deda8f9ee37095ad329c2bd34950a3 (diff) |
Initial checkin of sass_binary support for bazel
RELNOTES[NEW]: Support for build with libsass.
--
Change-Id: I2a24212d9466e2e2a8b653027f1cc9579b4d4221
Reviewed-on: https://bazel-review.googlesource.com/#/c/1990/
MOS_MIGRATED_REVID=103740130
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sass/hello_world/BUILD | 13 | ||||
-rw-r--r-- | examples/sass/hello_world/main.scss | 13 | ||||
-rw-r--r-- | examples/sass/shared/BUILD | 15 | ||||
-rw-r--r-- | examples/sass/shared/_colors.scss | 5 | ||||
-rw-r--r-- | examples/sass/shared/_fonts.scss | 5 |
5 files changed, 51 insertions, 0 deletions
diff --git a/examples/sass/hello_world/BUILD b/examples/sass/hello_world/BUILD new file mode 100644 index 0000000000..7109872d52 --- /dev/null +++ b/examples/sass/hello_world/BUILD @@ -0,0 +1,13 @@ +package(default_visibility = ["//visibility:public"]) + +load("/tools/build_defs/sass/sass", "sass_binary") + +# Import our shared colors and fonts so we can generate a CSS file. +sass_binary( + name = "hello_world", + src = "main.scss", + deps = [ + "//examples/sass/shared:colors", + "//examples/sass/shared:fonts", + ], +) diff --git a/examples/sass/hello_world/main.scss b/examples/sass/hello_world/main.scss new file mode 100644 index 0000000000..3b560b7bb6 --- /dev/null +++ b/examples/sass/hello_world/main.scss @@ -0,0 +1,13 @@ +@import 'examples/sass/shared/fonts'; +@import 'examples/sass/shared/colors'; + +html { + body { + font-family: $default-font-stack; + + h1 { + color: $example-red; + font-family: $modern-font-stack; + } + } +} diff --git a/examples/sass/shared/BUILD b/examples/sass/shared/BUILD new file mode 100644 index 0000000000..c9bdc2f500 --- /dev/null +++ b/examples/sass/shared/BUILD @@ -0,0 +1,15 @@ +package(default_visibility = ["//visibility:public"]) + +load("/tools/build_defs/sass/sass", "sass_library") + +# make a :colors target that any sass_binary rules can depend on. +sass_library( + name = "colors", + srcs = ["_colors.scss"], +) + +# make a :fonts target that any sass_binary rules can depend on. +sass_library( + name = "fonts", + srcs = ["_fonts.scss"], +) diff --git a/examples/sass/shared/_colors.scss b/examples/sass/shared/_colors.scss new file mode 100644 index 0000000000..cd1430b0a9 --- /dev/null +++ b/examples/sass/shared/_colors.scss @@ -0,0 +1,5 @@ +// Colors that all Sass code can share. + +$example-blue: #00f; +$example-red: #f00; +$example-green: #008000; diff --git a/examples/sass/shared/_fonts.scss b/examples/sass/shared/_fonts.scss new file mode 100644 index 0000000000..6fea9aec8d --- /dev/null +++ b/examples/sass/shared/_fonts.scss @@ -0,0 +1,5 @@ +// Fonts that all Sass code can share. + +$default-font-stack: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; + +$modern-font-stack: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |