Line | |
---|
1 | /**
|
---|
2 | * Method which inserts a full background-image property for a theme image.
|
---|
3 | * It checks if the file exists and if it doesn't, it'll throw an error.
|
---|
4 | * By default it will not include the background-image property if it is not found,
|
---|
5 | * but this can be changed by changing the default value of $include-missing-images to
|
---|
6 | * be true.
|
---|
7 | */
|
---|
8 | @function theme-background-image($theme-name, $path, $without-url: false, $relative: false) {
|
---|
9 | $exists_image: theme-image($theme-name, $path, true, false);
|
---|
10 |
|
---|
11 | @if $exists_image {
|
---|
12 | $exists: theme_image_exists($exists_image);
|
---|
13 |
|
---|
14 | @if $exists == true {
|
---|
15 | @return theme-image($theme-name, $path, $without-url, $relative);
|
---|
16 | }
|
---|
17 | @else {
|
---|
18 | // @todo this needs to be smarter
|
---|
19 | // @warn "@theme-background-image: Theme image not found: #{$exists_image}";
|
---|
20 |
|
---|
21 | @if $include-missing-images {
|
---|
22 | @return theme-image($theme-name, $path, $without-url, $relative);
|
---|
23 | }
|
---|
24 |
|
---|
25 | @return none;
|
---|
26 | }
|
---|
27 | }
|
---|
28 | @else {
|
---|
29 | // @todo this needs to be smarter...
|
---|
30 | // @warn "@theme-background-image: No arguments passed";
|
---|
31 | }
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.