Skip to content

Commit

Permalink
Added support for Google Material design icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lo kesh committed Apr 1, 2017
1 parent e248e41 commit ca812ce
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add `pretty.min.css` in your html

From CDN,
```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pretty-checkbox/2.2.0/pretty.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pretty-checkbox/2.2.1/pretty.min.css"/>
```
or from the source,
```html
Expand Down Expand Up @@ -70,7 +70,7 @@ Refer the [Documentation](https://lokesh-coder.github.io/pretty-checkbox/) for o

### Custom font library

This library supports wide variety of font icon libraries. Currently tested with `FontAwesome` , `Bootstrap Glyphicon` , `Material Design icons (mdi)` , `Material Design icons (zmdi)` , `Typicons` , `Ionicons`.
This library supports wide variety of font icon libraries. Currently tested with `FontAwesome` , `Bootstrap Glyphicon` , `Google Material Design icons(material.io)`, `Material Design icons (mdi)` , `Material Design icons (zmdi)` , `Typicons` , `Ionicons`.

### What else

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pretty-checkbox",
"version": "2.2.0",
"version": "2.2.1",
"description": "Scalable css3 pretty checkbox and radio buttons with custom font icon library",
"main": "src/pretty.min.css",
"dependencies": {},
Expand Down
14 changes: 14 additions & 0 deletions src/pretty.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.pretty > input + label > i.g-mdi:before,
.pretty > input + label + label > i.g-mdi:before {
content: attr(data-icon);
display: inline-block;
font: normal normal normal 24px/1 "Material Icons";
font-size: inherit;
text-rendering: auto;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}

@media print {
.pretty > input:not(:checked) + label i:before {
-webkit-print-color-adjust: exact;
Expand Down
2 changes: 1 addition & 1 deletion src/pretty.min.css

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/scss/support/_extend.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.#{$pretty--class-name} {
& > input + label>i.#{$pretty--gmdi-class-name}:before,
& > input + label+label > i.#{$pretty--gmdi-class-name}:before{
content:attr(#{$pretty--gmdi-attr});
display: inline-block;
font: normal normal normal 24px/1 $pretty--gmdi-name;
font-size: inherit;
text-rendering: auto;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
}
1 change: 1 addition & 0 deletions src/scss/support/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'variables';
@import 'mixins';
@import 'extend';
@import 'animations';
@import 'print';
4 changes: 4 additions & 0 deletions src/scss/support/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ $pretty--color-border: #b9b9b9 !default;
$pretty--color-radio: #b9b9b9 !default;
$pretty--color-bg: #fff !default;

$pretty--gmdi-class-name:'g-mdi';
$pretty--gmdi-name:'Material Icons';
$pretty--gmdi-attr:'data-icon';

$outline-colors: (primary o-primary $pretty--color-primary, success o-success $pretty--color-success, info o-info $pretty--color-info, warning o-warning $pretty--color-warning, danger o-danger $pretty--color-danger);

0 comments on commit ca812ce

Please sign in to comment.