aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/sass/include/_mixins.scss
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-16 16:05:40 +0100
committerChocobozzz <me@florianbigard.com>2019-01-17 10:38:18 +0100
commit457bb213b273a9b206cc5654eb085cede4e916ad (patch)
tree6b1a317872a4ca27b5d0dbe543452320b26aacff /client/src/sass/include/_mixins.scss
parent848f499def54db2dd36437ef0dfb74dd5041c23b (diff)
downloadPeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.tar.gz
PeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.tar.zst
PeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.zip
Refactor how we use icons
Inject them in an angular component so we can easily change their color
Diffstat (limited to 'client/src/sass/include/_mixins.scss')
-rw-r--r--client/src/sass/include/_mixins.scss49
1 files changed, 35 insertions, 14 deletions
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index d6f391a45..1da240db8 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -55,6 +55,18 @@
55 hyphens: auto; 55 hyphens: auto;
56} 56}
57 57
58@mixin apply-svg-color ($color) {
59 /deep/ svg {
60 path[fill="#000000"], g[fill="#000000"], rect[fill="#000000"] {
61 fill: $color;
62 }
63
64 path[stroke="#000000"], g[stroke="#000000"], rect[stroke="#000000"] {
65 stroke: $color;
66 }
67 }
68}
69
58@mixin peertube-input-text($width) { 70@mixin peertube-input-text($width) {
59 display: inline-block; 71 display: inline-block;
60 height: $button-height; 72 height: $button-height;
@@ -110,22 +122,30 @@
110 color: #fff; 122 color: #fff;
111 background-color: #C6C6C6; 123 background-color: #C6C6C6;
112 } 124 }
125
126 my-global-icon {
127 @include apply-svg-color(#fff)
128 }
113} 129}
114 130
115@mixin grey-button { 131@mixin grey-button {
116 &, &:active, &:focus { 132 &, &:active, &:focus {
117 background-color: $grey-color; 133 background-color: $grey-background-color;
118 color: #585858; 134 color: $grey-foreground-color;
119 } 135 }
120 136
121 &:hover, &:active, &:focus, &[disabled], &.disabled { 137 &:hover, &:active, &:focus, &[disabled], &.disabled {
122 color: #585858; 138 color: $grey-foreground-color;
123 background-color: $grey-hoover-color; 139 background-color: $grey-background-hover-color;
124 } 140 }
125 141
126 &[disabled], &.disabled { 142 &[disabled], &.disabled {
127 cursor: default; 143 cursor: default;
128 } 144 }
145
146 my-global-icon {
147 @include apply-svg-color($grey-foreground-color)
148 }
129} 149}
130 150
131@mixin peertube-button { 151@mixin peertube-button {
@@ -148,6 +168,15 @@
148 @include peertube-button; 168 @include peertube-button;
149} 169}
150 170
171@mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
172 my-global-icon {
173 position: relative;
174 width: $width;
175 margin-right: $margin-right;
176 top: $top;
177 }
178}
179
151@mixin peertube-button-file ($width) { 180@mixin peertube-button-file ($width) {
152 position: relative; 181 position: relative;
153 overflow: hidden; 182 overflow: hidden;
@@ -455,18 +484,10 @@
455 } 484 }
456} 485}
457 486
458@mixin create-button ($imageUrl) { 487@mixin create-button {
459 @include peertube-button-link; 488 @include peertube-button-link;
460 @include orange-button; 489 @include orange-button;
461 490 @include button-with-icon(20px, 5px, -1px);
462 .icon.icon-add {
463 @include icon(20px);
464
465 position: relative;
466 top: -1px;
467 margin-right: 5px;
468 background-image: url($imageUrl);
469 }
470} 491}
471 492
472@mixin row-blocks { 493@mixin row-blocks {