Skip to content

Commit

Permalink
Add new icons and bump to 2.0.0 (#5)
Browse files Browse the repository at this point in the history
* Add font assets as a Git submodule
* Add font files to jar and the required scss code to inside the addon
* Update README.md
* Update enum for Icons 2.0
* Use latest Vaadin Framework version '7.7.3'.
* Update group and artifact id
* Update demo to show all icons
  • Loading branch information
enver-haase authored and Artur- committed Nov 15, 2016
1 parent 500a3d3 commit 566c917
Show file tree
Hide file tree
Showing 17 changed files with 222 additions and 1,275 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
.classpath
target
bin
styles.scss.cache
styles.css
addons.scss
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vaadin-icons/vaadin-icons-webcomponent"]
path = vaadin-icons/vaadin-icons-webcomponent
url = [email protected]:vaadin/vaadin-icons.git
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,15 @@ Official releases of this add-on are available at Vaadin Directory. For Maven in
## Usage

* Add the add-on to your Vaadin project.
* Download the font files from [https://vaadin.com/font-icons/download](https://vaadin.com/font-icons/download).
* Copy the font files under `fonts` subdirectory in your theme.
* Add following lines to your theme.
* Ensure that your theme contains addons.scss and it contains the following lines.
These lines should appear automatically in addons.scss when mvn vaadin:update-theme goal is executed.
```
/* This font-face declaration must be outside your theme mixin. */
@font-face {
font-family: 'Vaadin-Icons';
src: url('fonts/Vaadin-Icons.eot');
src: url('fonts/Vaadin-Icons.eot?#iefix') format('embedded-opentype'),
url('fonts/Vaadin-Icons.woff') format('woff'),
url('fonts/Vaadin-Icons.ttf') format('truetype'),
url('fonts/Vaadin-Icons.svg#icomoon') format('svg');
}
.Vaadin-Icons {
font-family: 'Vaadin-Icons';
@import "../../../VAADIN/addons/vaadin-icons/vaadin-icons.scss";
/* Import and include this mixin into your project theme to include the addon themes */
@mixin addons {
@include vaadin-icons;
}
```
* Use the icons in your code as follows.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.vaadin.icons</groupId>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-icons-root</artifactId>
<packaging>pom</packaging>
<version>1.0.1</version>
<version>2.0.0</version>
<name>Vaadin Icons Add-on Root Project</name>

<modules>
Expand Down
112 changes: 8 additions & 104 deletions vaadin-icons-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.vaadin.icons</groupId>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-icons-demo</artifactId>
<packaging>war</packaging>
<version>1.0.1</version>
<version>2.0.0</version>
<name>Vaadin Icons Add-on Demo</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.5.0</vaadin.version>
<vaadin.version>7.7.3</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>

<!--
<organization>
<name>My Name</name>
<url>https://github.com/mygithubaccount/MyComponent/</url>
</organization>
<scm>
<url>git://github.com/mygithubaccount/MyComponent.git</url>
<connection>scm:git:git://github.com/mygithubaccount/MyComponent.git</connection>
<developerConnection>scm:git:ssh://[email protected]:/mygithubaccount/${ComponentClassName}.git</developerConnection>
<tag>MyComponent add-on for Vaadin</tag>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/mygithubaccount/MyComponent/issues</url>
</issueManagement>
-->

<licenses>
<license>
<name>Apache 2</name>
Expand All @@ -41,36 +23,6 @@
</license>
</licenses>

<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand All @@ -85,9 +37,9 @@

<dependencies>
<dependency>
<groupId>org.vaadin.teemu</groupId>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-icons</artifactId>
<version>${version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Expand Down Expand Up @@ -118,71 +70,23 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<!-- Clean-up widgetset required for "inplace" compilation -->
<directory>${basedir}/src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
<fileset>
<!-- Clean-up gwt cache -->
<directory>${basedir}/src/main/webapp/VAADIN/gwt-unitCache</directory>
</fileset>
</filesets>
</configuration>
</plugin>

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<packagingExcludes>
**/VAADIN/gwt-unitCache/**,
**/VAADIN/widgetsets/WEB-INF/**,
**/WEB-INF/lib/servlet-api-*.jar,
**/WEB-INF/lib/vaadin-client-*.jar,
**/WEB-INF/lib/jetty-*.jar,
**/WEB-INF/lib/ant-*.jar,
**/WEB-INF/classes/gwt-unitCache/**,
**/WEB-INF/classes/themes/**,
**/WEB-INF/classes/widgetsets/**
</packagingExcludes>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<persistentunitcachedir>${basedir}/target/tmp/gwt-unitCache</persistentunitcachedir>
<compileReport>true</compileReport>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<!-- You are free to mark this as permanently ignored in Eclipse -->
<execution>
<configuration>
<!-- if you don't specify any modules, the plugin will find them -->
</configuration>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<goal>compile-theme</goal>
<goal>update-theme</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package org.vaadin.teemu.demo;
package com.vaadin.demo;

import javax.servlet.annotation.WebServlet;

import org.vaadin.teemu.VaadinIcons;
import com.vaadin.icons.VaadinIcons;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

Expand All @@ -30,9 +31,11 @@ protected void init(VaadinRequest request) {
layout.setSizeFull();
setContent(layout);

Button button = new Button("Click Me", VaadinIcons.VAADIN_V);
layout.addComponent(button);
layout.setComponentAlignment(button, Alignment.MIDDLE_CENTER);
String allIcons = "";
for (VaadinIcons ic : VaadinIcons.values()) {
allIcons += ic.getHtml() + "&nbsp;";
}
layout.addComponent(new Label(allIcons, ContentMode.HTML));
}

}

This file was deleted.

17 changes: 1 addition & 16 deletions vaadin-icons-demo/src/main/webapp/VAADIN/themes/demo/demo.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Global variable overrides. Must be declared before importing Valo.

// Defines the plaintext font size, weight and family. Font size affects general component sizing.
$v-font-size: 32px;
$v-font-size: 16px;
//$v-font-weight: 300;
//$v-font-family: "Open Sans", sans-serif;

Expand Down Expand Up @@ -29,23 +29,8 @@ $v-font-size: 32px;

@import "../valo/valo.scss";



@mixin demo {
@include valo;

// Insert your own theme rules here
}

@font-face {
font-family: 'Vaadin-Icons';
src: url('fonts/Vaadin-Icons.eot');
src: url('fonts/Vaadin-Icons.eot?#iefix') format('embedded-opentype'),
url('fonts/Vaadin-Icons.woff') format('woff'),
url('fonts/Vaadin-Icons.ttf') format('truetype'),
url('fonts/Vaadin-Icons.svg#icomoon') format('svg');
}
.Vaadin-Icons {
font-family: 'Vaadin-Icons';
}

Binary file not shown.
Loading

0 comments on commit 566c917

Please sign in to comment.