Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vwc-badge): element invisibility due to wrong z-indexing #717

Merged
merged 34 commits into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e6fb08c
fix(vwc-badge): element invisibility due to wrong z-indexing
yinonov Mar 20, 2021
e477b7a
tests pass viv-435
yinonov Mar 20, 2021
53f4cef
badge direct refs
yinonov Mar 21, 2021
c22cfdc
connotation shade
yinonov Mar 21, 2021
6076623
badge vary from layout mixin
yinonov Mar 21, 2021
036d818
add scoped layout var to badge and icon-button
JoelGraham93 Mar 23, 2021
b549c21
Merge branch 'master' into viv-443-layout-mixin-scoped-vars
JoelGraham93 Mar 23, 2021
cbde660
safer scoped variables
yinonov Mar 23, 2021
dfb132c
comment
yinonov Mar 25, 2021
7e7e34f
added organized shades mixin
yinonov Mar 27, 2021
684140b
connotation mixins refactored
yinonov Mar 28, 2021
cbe6838
connotations default mixin
yinonov Mar 28, 2021
b5e5cfc
Merge branch 'master' into VIV-435-background-color-invisible
gullerya Mar 29, 2021
e3f9716
linear progress updated to new connotation mixin
yinonov Mar 30, 2021
84fd1cb
Merge branch 'VIV-435-background-color-invisible' of https://github.c…
yinonov Mar 30, 2021
447ce7a
icon button uses new connotation mixin
yinonov Mar 30, 2021
4fb1d9c
fix icon button
yinonov Mar 30, 2021
f5cb14a
switch use of new connotation mixin
yinonov Mar 30, 2021
345ffdc
note use of new connotation mixin
yinonov Mar 30, 2021
2e39c3d
button use of new connotation mixin
yinonov Mar 30, 2021
3583ba4
circular progress use new connotation mixin
yinonov Mar 30, 2021
6f804a0
remove shades
yinonov Mar 30, 2021
0da5ccc
context theme use new connotation mixin
yinonov Mar 30, 2021
8e6bb38
remove refactored connotation mixin
yinonov Mar 30, 2021
5d73486
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Mar 30, 2021
9fe1e79
remove announcement test from badge
yinonov Mar 30, 2021
a7f6a74
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Mar 30, 2021
796b190
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Mar 30, 2021
abbd940
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Mar 31, 2021
23b4ca6
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Apr 1, 2021
d24c3dc
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Apr 2, 2021
c7b1d51
Merge branch 'viv-443-layout-mixin-scoped-vars' into VIV-435-backgrou…
yinonov Apr 2, 2021
7453ca9
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Apr 2, 2021
e048136
Merge branch 'master' into VIV-435-background-color-invisible
yinonov Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions common/context/src/partials/_theme.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables';
@use '@vonage/vvd-foundation/scss/variable-names/color-base-variable-names' as color-base;
@use '@vonage/vvd-foundation/scss/variable-names/color-semantic-variable-names' as color-semantic;
@use '@vonage/vvd-foundation/scss/mixins/color-connotation-mixins' with (
$connotations: success alert warning info announcement
@use '@vonage/vvd-foundation/scss/mixins/color-connotation/variables' as connotation-variables;
@use '@vonage/vvd-foundation/scss/mixins/color-connotation' with (
$connotations-set: success alert warning info announcement,
$selector: 'blockquote#{connotation-variables.$compound-placeholder}'
);
@use 'variables';

Expand All @@ -12,10 +14,10 @@ body {
}

#{variables.$vivid-scope-selector} {
@include color-connotation-mixins.connotations-context(
'blockquote#{color-connotation-mixins.$connotation-placeholder}',
'info'
);

@include color-connotation.connotations-main;
@include color-connotation.connotations-main-default(info);

a {
color: var(
#{scheme-variables.$vvd-color-cta-70}
Expand Down
85 changes: 0 additions & 85 deletions common/foundation/scss/mixins/_color-connotation-mixins.scss

This file was deleted.

11 changes: 4 additions & 7 deletions common/foundation/scss/mixins/_layout-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@ $all-layouts: (
ghost: 'ghost',
);

$bg: var(#{color-semantic.$vvd-color-connotation});

%filled {
#{$_prefix}background-color: #{$bg};
#{$_prefix}background-color: var(#{color-semantic.$vvd-color-connotation});
#{$_prefix}color: var(#{color-semantic.$vvd-color-on-connotation});
}

%outlined {
#{$_prefix}background-color: transparent;
#{$_prefix}border: 1px solid #{$bg};
#{$_prefix}color: #{$bg};
#{$_prefix}border: 1px solid var(#{color-semantic.$vvd-color-connotation});
#{$_prefix}color: var(#{color-semantic.$vvd-color-connotation});
}

%soft {
#{$_prefix}background-color: #{$bg};
#{$_prefix}background-color: var(#{color-semantic.$vvd-color-connotation}-soft);
#{$_prefix}color: var(#{scheme-variables.$vvd-color-on-base});
#{$_prefix}opaque: 20;
}

%text,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@use 'sass:selector';

@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables';
@use '../../variable-names/color-semantic-variable-names' as color-semantic;
@use '../../functions';
@use 'variables';

$_connotations-definition: (
pacific: linear-gradient(to right, var(#{scheme-variables.$vvd-color-info-30}), var(#{scheme-variables.$vvd-color-cta-70})),
);

// override to apply relevance
$connotations-decorative-set: predefined-connotations.$connotations-decorative-set !default;
$selector: variables.$selector !default;

@mixin connotations-decorative {
@each $name, $value in functions.pick-map($connotations-decorative-set, $_connotations-definition) {
$compound: '[connotation="#{$name}" i]';

$local-selector: selector.replace(
#{$selector},
#{variables.$compound-placeholder},
#{$compound}
);

#{$local-selector} {
#{color-semantic.$vvd-color-connotation}: $value;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@use 'sass:selector';

@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables';
@use '../../variable-names/color-semantic-variable-names' as color-semantic;
@use '../../functions';
@use 'predefined-connotations';
YonatanKra marked this conversation as resolved.
Show resolved Hide resolved
@use 'variables';

$_connotations-definition: (
primary: 'primary',
cta: 'cta',
success: 'success',
alert: 'alert',
warning: 'warning',
info: 'info',
announcement: 'announcement',
);

// override to apply relevance
$connotations-set: predefined-connotations.$connotations-set !default;
$selector: variables.$selector !default;

// selector can be altered by relevance
@mixin connotations-main {
@each $name in functions.pick-list($connotations-set, $_connotations-definition) {
$compound: '[connotation="#{$name}" i]';

$local-selector: selector.replace(
#{$selector},
#{variables.$compound-placeholder},
#{$compound}
);

#{$local-selector} {
@include connotation-main-variables($name);
}
}
}

@mixin connotations-main-default($name) {
$compound: ':not([connotation])';

$local-selector: selector.replace(
#{$selector},
#{variables.$compound-placeholder},
#{$compound}
);

#{$local-selector} {
@include connotation-main-variables($name);
}
}

@mixin connotation-main-variables($name) {
#{color-semantic.$vvd-color-connotation}: var(--vvd-color-#{$name});
#{color-semantic.$vvd-color-on-connotation}: var(--vvd-color-on-#{$name});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@use 'sass:selector';
@use '../../functions';
@use '../../variable-names/color-semantic-variable-names' as color-semantic;
@use 'predefined-connotations';
@use 'variables';

$_connotations-definition: (
primary: (soft: neutral-20, accent: neutral-30),
cta: (soft: cta-20, accent: cta-60),
success: (soft: success-20, accent: success-60),
alert: (soft: alert-20, accent: alert-60),
warning: (soft: warning-20, accent: warning-60),
info: (soft: info-20, accent: info-60),
announcement: (soft: announcement-20, accent: announcement-60)
);

// override to apply relevance
$connotations-set: predefined-connotations.$connotations-set !default;
$selector: variables.$selector !default;

@mixin connotations-shades {
@each $c_name, $value in functions.pick-map($connotations-set, $_connotations-definition) {
$compound: '[connotation="#{$c_name}" i]';

$local-selector: selector.replace(
#{$selector},
#{variables.$compound-placeholder},
#{$compound}
);

#{$local-selector} {
@each $s_name, $s_value in $value {
#{color-semantic.$vvd-color-connotation}-#{$s_name}: var(--vvd-color-#{$s_value});
}
}
}
}

21 changes: 21 additions & 0 deletions common/foundation/scss/mixins/color-connotation/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@use 'predefined-connotations';
@use 'variables';

$selector: variables.$selector !default;
$connotations-set: predefined-connotations.$connotations-set !default;
$connotations-decorative-set: predefined-connotations.$connotations-decorative-set !default;

@forward 'color-connotation-main.mixin' show connotations-main, connotations-main-default with (
$connotations-set: $connotations-set,
$selector: $selector
);

@forward 'color-connotation-shades.mixin' show connotations-shades with (
$connotations-set: $connotations-set,
$selector: $selector
);

@forward 'color-connotation-decorative.mixin' show connotations-decorative with (
$connotations-decorative-set: $connotations-decorative-set,
$selector: $selector
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$connotations-set: primary cta success alert warning info announcement !default;
$connotations-decorative-set: pacific !default;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$compound-placeholder: '[compound]';
$selector: ':host(#{$compound-placeholder})' !default;
2 changes: 1 addition & 1 deletion components/badge/src/vwc-badge-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type BadgeShape = Extract<Shape, Shape.Rounded | Shape.Pill>;

export class BadgeBase extends LitElement {
@property({ type: String, reflect: true })
connotation: BadgeConnotation = Connotation.Primary;
connotation?: BadgeConnotation;

@property({ type: String, reflect: true })
shape?: BadgeShape;
Expand Down
Loading