Skip to content

Commit

Permalink
fix(Tag): try to re-calculate Tag text color on client side in SSR apps
Browse files Browse the repository at this point in the history
  • Loading branch information
MarineLB committed Oct 23, 2023
1 parent 2b2ba3c commit 4d68b77
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@makesenseorg/design-system",
"version": "1.17.12-next.0",
"version": "1.17.12-next.1",
"engines": {
"node": "16.x"
},
Expand Down
26 changes: 13 additions & 13 deletions src/system/components/atoms/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,20 +272,20 @@ export default {
&--animate-icon {
transition: all .3s ease;
svg {
height: 25px;
margin-left: 0;
margin-right: 0;
position: relative;
opacity: 0;
width: 0;
transition: all .3s ease;
}
svg {
height: 25px;
margin-left: 0;
margin-right: 0;
position: relative;
opacity: 0;
width: 0;
transition: all .3s ease;
}
&:hover svg {
width: 25px;
opacity: 1;
}
&:hover svg {
width: 25px;
opacity: 1;
}
}
@mixin type-text {
Expand Down
17 changes: 13 additions & 4 deletions src/system/components/atoms/tag/Tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ export default {
}
},
emits: ["click"],
data() {
return {
contrastColor: null
}
},
computed: {
isCliquable() {
return this.cliquable ? "cliquable" : "not-cliquable";
Expand All @@ -138,14 +143,18 @@ export default {
if (this.label.length > 30) return this.label.substring(0, 30) + "...";
else return this.label;
},
contrastColor() {
if (process.server) return getContrastColor(this.color);
if (process.client) return getContrastColor(this.color);
},
// contrastColor() {
// if (process.server) return getContrastColor(this.color);
// if (process.client) return getContrastColor(this.color);
// },
hoverColor() {
return getHoverColor(this.color);
}
},
mounted() {
if (process.server) this.contrastColor = getContrastColor(this.color);
if (process.client) this.contrastColor = getContrastColor(this.color);
},
methods: {
onClick: function() {
this.$emit("click");
Expand Down

0 comments on commit 4d68b77

Please sign in to comment.