Put CSS generation in a Maven profile

This commit is contained in:
Dave Syer 2021-11-24 07:45:21 +00:00
parent 7ea283613d
commit ff2febe09f
6 changed files with 8197 additions and 45 deletions

96
pom.xml
View file

@ -229,51 +229,6 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<?m2e execute onConfiguration,onIncremental?>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/webjars</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.gitlab.haynes</groupId>
<artifactId>libsass-maven-plugin</artifactId>
<version>0.2.26</version>
<executions>
<execution>
<phase>generate-resources</phase>
<?m2e execute onConfiguration,onIncremental?>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<inputPath>${basedir}/src/main/scss/</inputPath>
<outputPath>${basedir}/target/classes/static/resources/css/</outputPath>
<includePath>${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/</includePath>
</configuration>
</plugin>
</plugins>
</build>
@ -323,6 +278,57 @@
</pluginRepositories>
<profiles>
<profile>
<id>css</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<?m2e execute onConfiguration,onIncremental?>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/webjars</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.gitlab.haynes</groupId>
<artifactId>libsass-maven-plugin</artifactId>
<version>0.2.26</version>
<executions>
<execution>
<phase>generate-resources</phase>
<?m2e execute onConfiguration,onIncremental?>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<inputPath>${basedir}/src/main/scss/</inputPath>
<outputPath>${basedir}/src/main/resources/static/resources/css/</outputPath>
<includePath>${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/</includePath>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>m2e</id>
<activation>

View file

@ -46,6 +46,10 @@ docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PAS
Further documentation is provided [here](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt).
## Compiling the CSS
There is a `petclinic.css` in `src/main/resources/static/resources/css`. It was generated from the `petclinic.scss` source, combined with the [Bootstrap](https://getbootstrap.com/) library. If you make changes to the `scss`, or upgrade Bootstrap, you will need to re-compile the CSS resources using the Maven profile "css", i.e. `./mvnw package -P css`.
## Working with Petclinic in your IDE
### Prerequisites

View file

@ -0,0 +1,62 @@
.navbar {
border-top: 4px solid #6db33f;
background-color: #34302d;
margin-bottom: 0px;
border-bottom: 0;
border-left: 0;
border-right: 0; }
.navbar a.navbar-brand {
background: url("../images/spring-logo-dataflow.png") -1px -1px no-repeat;
margin: 12px 0 6px;
width: 229px;
height: 46px;
display: inline-block;
text-decoration: none;
padding: 0; }
.navbar a.navbar-brand span {
display: block;
width: 229px;
height: 46px;
background: url("../images/spring-logo-dataflow.png") -1px -48px no-repeat;
opacity: 0;
-moz-transition: opacity 0.12s ease-in-out;
-webkit-transition: opacity 0.12s ease-in-out;
-o-transition: opacity 0.12s ease-in-out; }
.navbar a.navbar-brand:hover span {
opacity: 1; }
.navbar li > a, .navbar-text {
font-family: "montserratregular", sans-serif;
text-shadow: none;
font-size: 14px;
/* line-height: 14px; */
padding: 28px 20px;
transition: all 0.15s;
-webkit-transition: all 0.15s;
-moz-transition: all 0.15s;
-o-transition: all 0.15s;
-ms-transition: all 0.15s; }
.navbar li > a {
text-transform: uppercase; }
.navbar .navbar-text {
margin-top: 0;
margin-bottom: 0; }
.navbar li:hover > a {
color: #eeeeee;
background-color: #6db33f; }
.navbar-toggle {
border-width: 0; }
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 3px; }
.navbar-toggle .icon-bar {
width: 19px;
height: 3px; }
/*# sourceMappingURL=../../../../../../target/header.css.map */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,28 @@
@media (max-width: 768px) {
.navbar-toggle {
position: absolute;
z-index: 9999;
left: 0px;
top: 0px; }
.navbar a.navbar-brand {
display: block;
margin: 0 auto 0 auto;
width: 148px;
height: 50px;
float: none;
background: url("../images/spring-logo-dataflow-mobile.png") 0 center no-repeat; }
.homepage-billboard .homepage-subtitle {
font-size: 21px;
line-height: 21px; }
.navbar a.navbar-brand span {
display: none; }
.navbar {
border-top-width: 0; }
.xd-container {
margin-top: 20px;
margin-bottom: 30px; }
.index-page--subtitle {
margin-top: 10px;
margin-bottom: 30px; } }
/*# sourceMappingURL=../../../../../../target/responsive.css.map */

View file

@ -0,0 +1,43 @@
@font-face {
font-family: 'varela_roundregular';
src: url("../fonts/varela_round-webfont.eot");
src: url("../fonts/varela_round-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/varela_round-webfont.woff") format("woff"), url("../fonts/varela_round-webfont.ttf") format("truetype"), url("../fonts/varela_round-webfont.svg#varela_roundregular") format("svg");
font-weight: normal;
font-style: normal; }
@font-face {
font-family: 'montserratregular';
src: url("../fonts/montserrat-webfont.eot");
src: url("../fonts/montserrat-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/montserrat-webfont.woff") format("woff"), url("../fonts/montserrat-webfont.ttf") format("truetype"), url("../fonts/montserrat-webfont.svg#montserratregular") format("svg");
font-weight: normal;
font-style: normal; }
body, h1, h2, h3, p, input {
margin: 0;
font-weight: 400;
font-family: "varela_roundregular", sans-serif;
color: #34302d; }
h1 {
font-size: 24px;
line-height: 30px;
font-family: "montserratregular", sans-serif; }
h2 {
font-size: 18px;
font-weight: 700;
line-height: 24px;
margin-bottom: 10px;
font-family: "montserratregular", sans-serif; }
h3 {
font-size: 16px;
line-height: 24px;
margin-bottom: 10px;
font-weight: 700; }
strong {
font-weight: 700;
font-family: "montserratregular", sans-serif; }
/*# sourceMappingURL=../../../../../../target/typography.css.map */