Skip to content

Commit

Permalink
Merge pull request #68 from crdschurch/defect/DE2885-use-inline-svgs
Browse files Browse the repository at this point in the history
DE2885 - Use Inline SVG
  • Loading branch information
tcmacdonald committed Mar 9, 2017
2 parents 5558e4d + e409de7 commit 42bc410
Show file tree
Hide file tree
Showing 30 changed files with 184 additions and 311 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ If using webpack, the `copy-webpack-plugin` can be used to move the svg files to
plugins: [
new CopyWebpackPlugin([
{
context: './node_modules/crds-styles/assets/stylesheets/svg/assets',
context: './node_modules/crds-styles/assets/svgs/',
from: '*.svg',
to: 'assets',
to: 'assets'
}
])
]
Expand Down
1 change: 0 additions & 1 deletion assets/stylesheets/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
@import 'base/modules';
@import 'components/modules';
@import 'themes/modules';
@import 'svg/sprite';
@import 'utilities/modules';
22 changes: 4 additions & 18 deletions assets/stylesheets/components/_button-form-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@
background: $cr-teal;
border-color: $cr-teal;
color: $cr-white;

.icon {
filter: invert(100%);
}
}

.svg-check-circle {
.icon.check-circle {
display: none;
}

&.active {
.svg-check-circle {
.icon.check-circle {
display: inline-block;
filter: invert(100%);
}

.svg-circle-thin {
.icon.circle-thin {
display: none;
}
}
Expand All @@ -38,14 +33,7 @@

.custom-input-icon {
padding: 10px;

i {
filter: invert(55%);

.dark-theme & {
filter: invert(45%);
}
}
color: $cr-gray-light;
}

.custom-input-field {
Expand All @@ -62,9 +50,7 @@

.btn-group-icons {
padding-right: .5rem;

.icon {
filter: invert(55%);
vertical-align: middle;
}
}
Expand Down
17 changes: 7 additions & 10 deletions assets/stylesheets/components/_datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,18 @@ datepicker {
}

.glyphicon {
@extend .icon;
@extend .icon-1;

&.glyphicon-chevron-left {
@extend .svg-chevron-left;
}
&.glyphicon-chevron-right {
@extend .svg-chevron-right;
@extend .chevron-left;
}
}
datepicker-inner .glyphicon {
&.glyphicon-chevron-left,
&.glyphicon-chevron-right {
@extend .icon;
@extend .icon-1;
@extend .chevron-right;
}
}

background-size: cover;
}

tbody {
.btn {
Expand Down
4 changes: 4 additions & 0 deletions assets/stylesheets/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ textarea {
position: relative;
display: block;

.input-group-addon {
color: $cr-gray;
}

&.input-group-left {
input.form-control {
padding-right: 10px;
Expand Down
114 changes: 95 additions & 19 deletions assets/stylesheets/components/_icons.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,101 @@
$dimensions: 16px;

i {
text-indent:200%;
white-space:nowrap;
overflow:hidden;
display:inline-block;
background-size:32px 32px;
%icon-dimensions {
width: $dimensions * 2;
height: $dimensions * 2;
background-size: $dimensions * 2;
@for $i from 1 through 6 {
&.icon-#{$i} {
width: $dimensions * $i;
height: $dimensions * $i;
background-size: $dimensions * $i;
}
}
}

.icon:not(svg) {
text-indent: 200%;
white-space: nowrap;
overflow: hidden;
display: inline-block;
background-size: 32px 32px;
}

svg.icon {
width: $dimensions * 2;
height: $dimensions * 2;
@for $i from 1 through 6 {
&.icon-#{$i} {
width: $dimensions * $i;
height: $dimensions * $i;
background-size: $dimensions * $i;
}
}

use {
fill: currentColor;
}
@extend %icon-dimensions;
use {
fill: currentColor;
}
}

%svg-common {
background-image: url("assets/svgs/icons.css.svg");
background-repeat: no-repeat;
@extend %icon-dimensions;

.dark-theme & {
filter: invert(75%);
-webkit-filter: invert(75%);
}
}

.icon.calendar:not(svg) {
@extend %svg-common;
background-position: 0 0;
}

.icon.check-circle:not(svg) {
@extend %svg-common;
background-position: 0 9.090909090909092%;
}

.icon.chevron-left:not(svg) {
@extend %svg-common;
background-position: 0 18.181818181818183%;
}

.icon.chevron-right:not(svg) {
@extend %svg-common;
background-position: 0 27.272727272727273%;
}

.icon.circle-thin:not(svg) {
@extend %svg-common;
background-position: 0 36.36363636363637%;
}

.icon.contrast:not(svg) {
@extend %svg-common;
background-position: 0 45.45454545454545%;
}

.icon.facebook:not(svg) {
@extend %svg-common;
background-position: 0 54.54545454545455%;
}

.icon.github:not(svg) {
@extend %svg-common;
background-position: 0 63.63636363636363%;
}

.icon.instagram:not(svg) {
@extend %svg-common;
background-position: 0 72.72727272727273%;
}

.icon.twitter:not(svg) {
@extend %svg-common;
background-position: 0 81.81818181818181%;
}

.icon.usd:not(svg) {
@extend %svg-common;
background-position: 0 90.9090909090909%;
}

.icon.youtube:not(svg) {
@extend %svg-common;
background-position: 0 100%;
}

2 changes: 1 addition & 1 deletion assets/stylesheets/components/_modules.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import 'icons';
@import 'typography';
@import 'headings';
@import 'alerts';
Expand All @@ -7,4 +8,3 @@
@import 'buttons';
@import 'button-form-group';
@import 'tables';
@import 'icons';
110 changes: 0 additions & 110 deletions assets/stylesheets/svg/_sprite.scss

This file was deleted.

Loading

0 comments on commit 42bc410

Please sign in to comment.