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(cc): no classes styling the same CSS properties are set on one element #192

Merged
merged 16 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion components/alert/w-alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const model = createModel({ props, emit });
const alertColorType = computed(() => possibleTypeProps.find((e) => props[e]));
const activeWrapperClassNames = computed(() => ccAlert[alertColorType.value]);
const activeIconClassNames = computed(() => ccAlert[`${alertColorType.value}Icon`]);
const wrapperClass = computed(() => [ccAlert.alert, activeWrapperClassNames.value]);
const wrapperClass = computed(() => [ccAlert.wrapper, activeWrapperClassNames.value]);
const iconClass = computed(() => [ccAlert.icon, activeIconClassNames.value]);

const iconComponent = computed(() => {
Expand Down
20 changes: 10 additions & 10 deletions components/attention/locales/da/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,58 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: da\n"
"X-Crowdin-File-ID: 12406\n"
"PO-Revision-Date: \n"

#. Default screenreader message for callout speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:138
#: components/attention/w-attention.vue:152
msgid "attention.aria.callout"
msgstr "En grøn taleboble der introducerer noget nyt"

#. Aria label for the close button in attention
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:89
#: components/attention/w-attention.vue:96
msgid "attention.aria.close"
msgstr "Luk"

#. Default screenreader message for highlighted speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:152
#: components/attention/w-attention.vue:164
msgid "attention.aria.highlight"
msgstr "En opmærksomhedsskabende taleboble med vigtig information"

#. Default screenreader message for bottom direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:109
#: components/attention/w-attention.vue:124
msgid "attention.aria.pointingDown"
msgstr "peger nedad"

#. Default screenreader message for left direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:116
#: components/attention/w-attention.vue:132
msgid "attention.aria.pointingLeft"
msgstr "peger til venstre"

#. Default screenreader message for right direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:102
#: components/attention/w-attention.vue:116
msgid "attention.aria.pointingRight"
msgstr "peger til højre"

#. Default screenreader message for top direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:95
#: components/attention/w-attention.vue:108
msgid "attention.aria.pointingUp"
msgstr "peger opad"

#. Default screenreader message for popover speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:145
#: components/attention/w-attention.vue:158
msgid "attention.aria.popover"
msgstr "En hvid taleboble med mere information"

#. Default screenreader message for tooltip in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:131
#: components/attention/w-attention.vue:146
msgid "attention.aria.tooltip"
msgstr "En sort taleboble med flere oplysninger"

19 changes: 9 additions & 10 deletions components/attention/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,54 @@ msgstr ""

#. Default screenreader message for callout speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:138
#: components/attention/w-attention.vue:152
msgid "attention.aria.callout"
msgstr "A green speech bubble introducing something new"

#. Aria label for the close button in attention
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:89
#: components/attention/w-attention.vue:96
msgid "attention.aria.close"
msgstr "Close"

#. Default screenreader message for highlighted speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:152
#: components/attention/w-attention.vue:164
msgid "attention.aria.highlight"
msgstr "An attention speech bubble with important information"

#. Default screenreader message for bottom direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:109
#: components/attention/w-attention.vue:124
msgid "attention.aria.pointingDown"
msgstr "pointing down"

#. Default screenreader message for left direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:116
#: components/attention/w-attention.vue:132
msgid "attention.aria.pointingLeft"
msgstr "pointing left"

#. Default screenreader message for right direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:102
#: components/attention/w-attention.vue:116
msgid "attention.aria.pointingRight"
msgstr "pointing right"

#. Default screenreader message for top direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:95
#: components/attention/w-attention.vue:108
msgid "attention.aria.pointingUp"
msgstr "pointing up"

#. Default screenreader message for popover speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:145
#: components/attention/w-attention.vue:158
msgid "attention.aria.popover"
msgstr "A white speech bubble providing additional information"

#. Default screenreader message for tooltip in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:131
#: components/attention/w-attention.vue:146
msgid "attention.aria.tooltip"
msgstr "A black speech bubble providing complementary information"

20 changes: 10 additions & 10 deletions components/attention/locales/fi/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,58 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: fi\n"
"X-Crowdin-File-ID: 12406\n"
"PO-Revision-Date: \n"

#. Default screenreader message for callout speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:138
#: components/attention/w-attention.vue:152
msgid "attention.aria.callout"
msgstr "Vihreä puhekupla, joka esittelee jotain uutta"

#. Aria label for the close button in attention
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:89
#: components/attention/w-attention.vue:96
msgid "attention.aria.close"
msgstr "Sulje"

#. Default screenreader message for highlighted speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:152
#: components/attention/w-attention.vue:164
msgid "attention.aria.highlight"
msgstr "Puhekupla, joka sisältää tärkeää tietoa"

#. Default screenreader message for bottom direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:109
#: components/attention/w-attention.vue:124
msgid "attention.aria.pointingDown"
msgstr "osoittaa alas"

#. Default screenreader message for left direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:116
#: components/attention/w-attention.vue:132
msgid "attention.aria.pointingLeft"
msgstr "osoittaa vasemmalle"

#. Default screenreader message for right direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:102
#: components/attention/w-attention.vue:116
msgid "attention.aria.pointingRight"
msgstr "osoittaa oikealle"

#. Default screenreader message for top direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:95
#: components/attention/w-attention.vue:108
msgid "attention.aria.pointingUp"
msgstr "osoittaa ylös"

#. Default screenreader message for popover speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:145
#: components/attention/w-attention.vue:158
msgid "attention.aria.popover"
msgstr "Valkoinen puhekupla, joka tarjoaa lisätietoa"

#. Default screenreader message for tooltip in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:131
#: components/attention/w-attention.vue:146
msgid "attention.aria.tooltip"
msgstr "Musta puhekupla, joka tarjoaa täydentävää tietoa"

20 changes: 10 additions & 10 deletions components/attention/locales/nb/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,58 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: nb\n"
"X-Crowdin-File-ID: 12406\n"
"PO-Revision-Date: \n"

#. Default screenreader message for callout speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:138
#: components/attention/w-attention.vue:152
msgid "attention.aria.callout"
msgstr "Grønn taleboble som introduserer noe nytt"

#. Aria label for the close button in attention
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:89
#: components/attention/w-attention.vue:96
msgid "attention.aria.close"
msgstr "Lukk"

#. Default screenreader message for highlighted speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:152
#: components/attention/w-attention.vue:164
msgid "attention.aria.highlight"
msgstr "En uthevet taleboble med viktig informasjon"

#. Default screenreader message for bottom direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:109
#: components/attention/w-attention.vue:124
msgid "attention.aria.pointingDown"
msgstr "peker ned"

#. Default screenreader message for left direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:116
#: components/attention/w-attention.vue:132
msgid "attention.aria.pointingLeft"
msgstr "peker til venstre"

#. Default screenreader message for right direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:102
#: components/attention/w-attention.vue:116
msgid "attention.aria.pointingRight"
msgstr "peker til høyre"

#. Default screenreader message for top direction in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:95
#: components/attention/w-attention.vue:108
msgid "attention.aria.pointingUp"
msgstr "peker opp"

#. Default screenreader message for popover speech bubble in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:145
#: components/attention/w-attention.vue:158
msgid "attention.aria.popover"
msgstr "En hvit taleboble som gir tilleggsinformasjon"

#. Default screenreader message for tooltip in the attention component
#. js-lingui-explicit-id
#: components/attention/w-attention.vue:131
#: components/attention/w-attention.vue:146
msgid "attention.aria.tooltip"
msgstr "En svart taleboble som forklarer konteksten"

5 changes: 1 addition & 4 deletions components/attention/w-attention.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ const props = defineProps({
});

const emit = defineEmits(['update:modelValue', 'dismiss']);
const attentionClasses = computed(() => ({
[props.attentionClass]: true,
[ccAttention.notCallout]: !props.callout,
}));
const attentionClasses = computed(() => [props.attentionClass, !props.callout && ccAttention.notCallout]);

const wrapperClasses = computed(() => [ccAttention.base, getVariantClasses(props).wrapper]);

Expand Down
12 changes: 5 additions & 7 deletions components/badge/w-badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ const props = defineProps({
const badgeClasses = computed(() => [
ccBadge.base,
ccBadge[props.variant],
{
[ccBadge.positionBase]: props.position,
[ccBadge.positionTL]: props.position === 'top-left',
[ccBadge.positionTR]: props.position === 'top-right',
[ccBadge.positionBR]: props.position === 'bottom-right',
[ccBadge.positionBL]: props.position === 'bottom-left',
},
!!props.position && ccBadge.positionBase,
props.position === 'top-left' && ccBadge.positionTL,
props.position === 'top-right' && ccBadge.positionTR,
props.position === 'bottom-right' && ccBadge.positionBR,
props.position === 'bottom-left' && ccBadge.positionBL,
]);
</script>

Expand Down
12 changes: 5 additions & 7 deletions components/box/w-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ const props = defineProps({
});

const boxClasses = computed(() => [
ccBox.box,
{
[ccBox.bleed]: props.bleed,
[ccBox.info]: props.info,
[ccBox.neutral]: props.neutral,
[ccBox.bordered]: props.bordered,
},
ccBox.base,
props.bleed && ccBox.bleed,
props.info && ccBox.info,
props.neutral && ccBox.neutral,
props.bordered && ccBox.bordered,
]);

const optOutRoleWithDefault = computed(() => (props.role === '' ? null : props.role ?? 'region'));
Expand Down
4 changes: 2 additions & 2 deletions components/breadcrumbs/locales/da/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: da\n"
"X-Crowdin-File-ID: 1354\n"
"PO-Revision-Date: \n"

#. Default screenreader message for the breadcrumb component
#. js-lingui-explicit-id
#: components/breadcrumbs/w-breadcrumbs.vue:13
#: components/breadcrumbs/w-breadcrumbs.vue:17
msgid "breadcrumbs.ariaLabel"
msgstr "Du er her"

3 changes: 1 addition & 2 deletions components/breadcrumbs/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ msgstr ""

#. Default screenreader message for the breadcrumb component
#. js-lingui-explicit-id
#: components/breadcrumbs/w-breadcrumbs.vue:13
#: components/breadcrumbs/w-breadcrumbs.vue:17
msgid "breadcrumbs.ariaLabel"
msgstr "You are here"

4 changes: 2 additions & 2 deletions components/breadcrumbs/locales/fi/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: fi\n"
"X-Crowdin-File-ID: 1354\n"
"PO-Revision-Date: \n"

#. Default screenreader message for the breadcrumb component
#. js-lingui-explicit-id
#: components/breadcrumbs/w-breadcrumbs.vue:13
#: components/breadcrumbs/w-breadcrumbs.vue:17
msgid "breadcrumbs.ariaLabel"
msgstr "Olet tässä"

4 changes: 2 additions & 2 deletions components/breadcrumbs/locales/nb/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ msgstr ""
"X-Crowdin-Project-ID: 141\n"
"X-Crowdin-Language: nb\n"
"X-Crowdin-File-ID: 1354\n"
"PO-Revision-Date: \n"

#. Default screenreader message for the breadcrumb component
#. js-lingui-explicit-id
#: components/breadcrumbs/w-breadcrumbs.vue:13
#: components/breadcrumbs/w-breadcrumbs.vue:17
msgid "breadcrumbs.ariaLabel"
msgstr "Her er du"

4 changes: 2 additions & 2 deletions components/button-group/w-button-group-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const vertical = inject('vertical', false);
const outlinedClass = computed(() => [
ccButtonGroupItem.outlined,
vertical.value ? ccButtonGroupItem.outlinedVertical : ccButtonGroupItem.outlinedHorizontal,
props.selected ? ccButtonGroupItem.outlinedSelected : '',
props.selected ? ccButtonGroupItem.outlinedSelected : ccButtonGroupItem.outlinedUnselected,
]);

const outlineResetClass = computed(() => [
Expand All @@ -20,7 +20,7 @@ const outlineResetClass = computed(() => [
const wrapperClass = computed(() => [
ccButtonGroupItem.wrapper,
outlined.value ? outlinedClass.value : outlineResetClass.value,
props.selected ? ccButtonGroupItem.selected : '',
props.selected ? ccButtonGroupItem.selected : ccButtonGroupItem.unselected,
]);
</script>

Expand Down
Loading
Loading