Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon van der Sluis
committed
May 16, 2012
1 parent
889fa73
commit 290d411
Showing
105 changed files
with
2,467 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
target | ||
.classpath | ||
|
||
.settings | ||
|
||
.project | ||
|
||
.idea | ||
|
||
*.iml | ||
.sass-cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/css/BourbonCssProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2012. | ||
* All rights reserved. | ||
*/ | ||
package ro.isdc.wro.extensions.processor.css; | ||
|
||
import ro.isdc.wro.extensions.processor.support.sass.RubySassEngine; | ||
import ro.isdc.wro.model.resource.ResourceType; | ||
import ro.isdc.wro.model.resource.SupportedResourceType; | ||
import ro.isdc.wro.model.resource.processor.ResourcePostProcessor; | ||
import ro.isdc.wro.model.resource.processor.ResourcePreProcessor; | ||
|
||
/** | ||
* A processor to support the bourbon (http://thoughtbot.com/bourbon/) mixins library for sass. | ||
* Using this processor automatically provides sass support, so there is no need to use both this one and | ||
* the {@link RubySassCssProcessor}. | ||
* <p/> | ||
* @author Simon van der Sluis | ||
* @created 16/05/12 | ||
*/ | ||
@SupportedResourceType(ResourceType.CSS) | ||
public class BourbonCssProcessor extends RubySassCssProcessor implements ResourcePreProcessor, ResourcePostProcessor { | ||
|
||
public static final String ALIAS = "bourbonCss"; | ||
|
||
private static final String BOURBON_GEM_REQUIRE = "bourbon"; | ||
|
||
/** | ||
* A getter used for lazy loading, overrides RubySassEngine#getEngine() and ensure the | ||
* bourbon gem is imported (required). | ||
*/ | ||
@Override | ||
protected RubySassEngine getEngine() { | ||
RubySassEngine engine = super.getEngine(); | ||
engine.addRequire(BOURBON_GEM_REQUIRE); | ||
return engine; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
wro4j-extensions/src/test/java/ro/isdc/wro/extensions/processor/TestBourbonCssProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2010. All rights reserved. | ||
*/ | ||
package ro.isdc.wro.extensions.processor; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import ro.isdc.wro.WroRuntimeException; | ||
import ro.isdc.wro.extensions.processor.css.BourbonCssProcessor; | ||
import ro.isdc.wro.extensions.processor.css.RubySassCssProcessor; | ||
import ro.isdc.wro.util.WroTestUtils; | ||
|
||
import java.io.*; | ||
import java.net.URL; | ||
|
||
|
||
/** | ||
* Test ruby sass css processor. | ||
* | ||
* @author Simon van der Sluis | ||
* @created Created on Apr 21, 2010 | ||
*/ | ||
public class TestBourbonCssProcessor | ||
{ | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(TestBourbonCssProcessor.class); | ||
|
||
/** Location (base) of bourbon sass css with bourbon test resources. */ | ||
private final URL url = getClass().getResource("bourboncss"); | ||
|
||
/** A RubySassEngine to test */ | ||
private BourbonCssProcessor bourbonCss; | ||
|
||
@Before | ||
public void initEngine() { | ||
bourbonCss = new BourbonCssProcessor() { | ||
@Override | ||
protected void onException(final WroRuntimeException e) { | ||
LOG.debug("[FAIL] Exception message is: {}", e.getMessage()); | ||
throw e; | ||
} | ||
}; | ||
} | ||
|
||
@Test | ||
public void testFromFolder() throws Exception { | ||
final File testFolder = new File(url.getFile(), "test"); | ||
final File expectedFolder = new File(url.getFile(), "expected"); | ||
WroTestUtils.compareFromDifferentFoldersByName(testFolder, expectedFolder, "scss", "css", bourbonCss); | ||
} | ||
|
||
|
||
} |
138 changes: 138 additions & 0 deletions
138
...src/test/resources/ro/isdc/wro/extensions/processor/bourboncss/expected/addon-buttons.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
button.normal { | ||
border: 1px solid #076fe4; | ||
-webkit-border-radius: 3px; | ||
-moz-border-radius: 3px; | ||
border-radius: 3px; | ||
-webkit-box-shadow: inset 0 1px 0 0 #8ebcf1; | ||
-moz-box-shadow: inset 0 1px 0 0 #8ebcf1; | ||
box-shadow: inset 0 1px 0 0 #8ebcf1; | ||
color: white; | ||
display: inline-block; | ||
font-size: 11px; | ||
font-weight: bold; | ||
background-color: #4294f0; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4294f0), color-stop(100%, #0776f3)); | ||
background-image: -webkit-linear-gradient(top, #4294f0, #0776f3); | ||
background-image: -moz-linear-gradient(top, #4294f0, #0776f3); | ||
background-image: -ms-linear-gradient(top, #4294f0, #0776f3); | ||
background-image: -o-linear-gradient(top, #4294f0, #0776f3); | ||
background-image: linear-gradient(top, #4294f0, #0776f3); | ||
padding: 7px 18px; | ||
text-decoration: none; | ||
text-shadow: 0 1px 0 #0065d6; | ||
-webkit-background-clip: padding-box; } | ||
button.normal:hover:not(:disabled) { | ||
-webkit-box-shadow: inset 0 1px 0 0 #60a2ec; | ||
-moz-box-shadow: inset 0 1px 0 0 #60a2ec; | ||
box-shadow: inset 0 1px 0 0 #60a2ec; | ||
cursor: pointer; | ||
background-color: #2f87ea; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2f87ea), color-stop(100%, #086fe3)); | ||
background-image: -webkit-linear-gradient(top, #2f87ea, #086fe3); | ||
background-image: -moz-linear-gradient(top, #2f87ea, #086fe3); | ||
background-image: -ms-linear-gradient(top, #2f87ea, #086fe3); | ||
background-image: -o-linear-gradient(top, #2f87ea, #086fe3); | ||
background-image: linear-gradient(top, #2f87ea, #086fe3); } | ||
button.normal:active:not(:disabled) { | ||
border: 1px solid #076fe4; | ||
-webkit-box-shadow: inset 0 0 8px 4px #0868d3, inset 0 0 8px 4px #0868d3, 0 1px 1px 0 #eeeeee; | ||
-moz-box-shadow: inset 0 0 8px 4px #0868d3, inset 0 0 8px 4px #0868d3, 0 1px 1px 0 #eeeeee; | ||
box-shadow: inset 0 0 8px 4px #0868d3, inset 0 0 8px 4px #0868d3, 0 1px 1px 0 #eeeeee; } | ||
button.normal:disabled { | ||
opacity: 0.5; | ||
cursor: not-allowed; } | ||
|
||
button.pill { | ||
border: 1px solid #3371b2; | ||
border-color: #3371b2 #2457a3 #164297; | ||
-webkit-border-radius: 16px; | ||
-moz-border-radius: 16px; | ||
border-radius: 16px; | ||
-webkit-box-shadow: inset 0 1px 0 0 #64a9f2, 0 1px 2px 0 #b3b3b3; | ||
-moz-box-shadow: inset 0 1px 0 0 #64a9f2, 0 1px 2px 0 #b3b3b3; | ||
box-shadow: inset 0 1px 0 0 #64a9f2, 0 1px 2px 0 #b3b3b3; | ||
color: white; | ||
display: inline-block; | ||
font-size: 11px; | ||
font-weight: normal; | ||
line-height: 1; | ||
background-color: #4294f0; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4294f0), color-stop(100%, #0156fe)); | ||
background-image: -webkit-linear-gradient(top, #4294f0, #0156fe); | ||
background-image: -moz-linear-gradient(top, #4294f0, #0156fe); | ||
background-image: -ms-linear-gradient(top, #4294f0, #0156fe); | ||
background-image: -o-linear-gradient(top, #4294f0, #0156fe); | ||
background-image: linear-gradient(top, #4294f0, #0156fe); | ||
padding: 5px 16px; | ||
text-align: center; | ||
text-decoration: none; | ||
text-shadow: 0 -1px 1px #2762bf; | ||
-webkit-background-clip: padding-box; } | ||
button.pill:hover:not(:disabled) { | ||
border: 1px solid #2062a7; | ||
border-color: #2062a7 #0e479a #01318e; | ||
-webkit-box-shadow: inset 0 1px 0 0 #519cf0; | ||
-moz-box-shadow: inset 0 1px 0 0 #519cf0; | ||
box-shadow: inset 0 1px 0 0 #519cf0; | ||
cursor: pointer; | ||
background-color: #2d88ee; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2d88ee), color-stop(100%, #1554ce)); | ||
background-image: -webkit-linear-gradient(top, #2d88ee, #1554ce); | ||
background-image: -moz-linear-gradient(top, #2d88ee, #1554ce); | ||
background-image: -ms-linear-gradient(top, #2d88ee, #1554ce); | ||
background-image: -o-linear-gradient(top, #2d88ee, #1554ce); | ||
background-image: linear-gradient(top, #2d88ee, #1554ce); | ||
text-shadow: 0 -1px 1px #134faf; | ||
-webkit-background-clip: padding-box; } | ||
button.pill:active:not(:disabled) { | ||
background: #226edd; | ||
border: 1px solid #0d3c8c; | ||
border-bottom: 1px solid #062d8d; | ||
-webkit-box-shadow: inset 0 0 6px 3px #0c44b8, 0 1px 0 0 white; | ||
-moz-box-shadow: inset 0 0 6px 3px #0c44b8, 0 1px 0 0 white; | ||
box-shadow: inset 0 0 6px 3px #0c44b8, 0 1px 0 0 white; | ||
text-shadow: 0 -1px 1px #1a52aa; } | ||
button.pill:disabled { | ||
opacity: 0.5; | ||
cursor: not-allowed; } | ||
|
||
button.shiny { | ||
border: 1px solid #8a0000; | ||
border-bottom: 1px solid #810000; | ||
-webkit-border-radius: 5px; | ||
-moz-border-radius: 5px; | ||
border-radius: 5px; | ||
-webkit-box-shadow: inset 0 1px 0 0 #ff1d0c; | ||
-moz-box-shadow: inset 0 1px 0 0 #ff1d0c; | ||
box-shadow: inset 0 1px 0 0 #ff1d0c; | ||
color: white; | ||
display: inline-block; | ||
font-size: 14px; | ||
font-weight: bold; | ||
background-color: red; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, red), color-stop(50%, #c70000), color-stop(50%, #a90000), color-stop(100%, #b00000)); | ||
background-image: -webkit-linear-gradient(top, red 0%, #c70000 50%, #a90000 50%, #b00000 100%); | ||
background-image: -moz-linear-gradient(top, red 0%, #c70000 50%, #a90000 50%, #b00000 100%); | ||
background-image: -ms-linear-gradient(top, red 0%, #c70000 50%, #a90000 50%, #b00000 100%); | ||
background-image: -o-linear-gradient(top, red 0%, #c70000 50%, #a90000 50%, #b00000 100%); | ||
background-image: linear-gradient(top, red 0%, #c70000 50%, #a90000 50%, #b00000 100%); | ||
padding: 8px 20px; | ||
text-align: center; | ||
text-decoration: none; | ||
text-shadow: 0 -1px 1px #730000; } | ||
button.shiny:hover:not(:disabled) { | ||
cursor: pointer; | ||
background-color: #f20000; | ||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f20000), color-stop(50%, #bd0000), color-stop(50%, #a20000), color-stop(100%, #a90000)); | ||
background-image: -webkit-linear-gradient(top, #f20000 0%, #bd0000 50%, #a20000 50%, #a90000 100%); | ||
background-image: -moz-linear-gradient(top, #f20000 0%, #bd0000 50%, #a20000 50%, #a90000 100%); | ||
background-image: -ms-linear-gradient(top, #f20000 0%, #bd0000 50%, #a20000 50%, #a90000 100%); | ||
background-image: -o-linear-gradient(top, #f20000 0%, #bd0000 50%, #a20000 50%, #a90000 100%); | ||
background-image: linear-gradient(top, #f20000 0%, #bd0000 50%, #a20000 50%, #a90000 100%); } | ||
button.shiny:active:not(:disabled) { | ||
-webkit-box-shadow: inset 0 0 20px 0 #900000, 0 1px 0 white; | ||
-moz-box-shadow: inset 0 0 20px 0 #900000, 0 1px 0 white; | ||
box-shadow: inset 0 0 20px 0 #900000, 0 1px 0 white; } | ||
button.shiny:disabled { | ||
opacity: 0.5; | ||
cursor: not-allowed; } |
Oops, something went wrong.