diff --git a/packages/core/src/components/tag/tag.scss b/packages/core/src/components/tag/tag.scss index dd30396d2..e417a52b9 100644 --- a/packages/core/src/components/tag/tag.scss +++ b/packages/core/src/components/tag/tag.scss @@ -2,20 +2,21 @@ :host { --icon-size: var(--spacing-small); - --atom-tag-height: 10px; + --atom-tag-height: var(--spacing-medium); line-height: 0; } .atom-tag { align-items: center; - border: solid 1px transparent; + box-sizing: border-box; color: var(--color-neutral-white); display: flex; font: var(--text-caption-focused); + font-weight: var(--font-weight-bold); height: var(--atom-tag-height); justify-content: center; letter-spacing: var(--text-caption-focused-letter); - padding: var(--spacing-xxsmall) var(--spacing-xsmall); + padding: 0 var(--spacing-xsmall); width: fit-content; &[color='warning'] { @@ -42,7 +43,7 @@ &[color='light'] { background-color: var(--color-neutral-light-5); border: 1px solid var(--color-neutral-light-3); - color: var(--color-neutral-regular); + color: var(--color-neutral-light-1); } } diff --git a/packages/core/src/components/tag/tag.spec.ts b/packages/core/src/components/tag/tag.spec.ts index a8774ed88..3e9735b94 100644 --- a/packages/core/src/components/tag/tag.spec.ts +++ b/packages/core/src/components/tag/tag.spec.ts @@ -1,6 +1,7 @@ import { newSpecPage } from '@stencil/core/testing' import { IconProps } from '../../icons' + import { AtomTag } from './tag' const setup = async ( @@ -39,8 +40,10 @@ describe('atom-tag', () => { const colorExists = atomTag?.shadowRoot?.innerHTML .split(' ') .find((el) => el === `color="${mockedColor}"`) + expect(colorExists).toBeTruthy() const atomTagLabel = page.root?.innerHTML + expect(atomTag?.nodeName.toLocaleLowerCase()).toBe('atom-tag') expect(atomTagLabel).toBe(tagLabel) }) @@ -48,8 +51,9 @@ describe('atom-tag', () => { it('should render atom-tag with icon', async () => { const mockedIcon = 'heart' const pageRoot = await setup('success', mockedIcon) + expect(pageRoot?.root?.shadowRoot) - .toEqualHtml(` + .toEqualHtml(` `) @@ -71,6 +75,7 @@ describe('atom-tag', () => { const customColorsExists = page?.root?.shadowRoot?.innerHTML.includes( `style="${customColors}"` ) + expect(customColorsExists).toBeTruthy() }) }) diff --git a/packages/core/src/components/tag/tag.tsx b/packages/core/src/components/tag/tag.tsx index 98d2a6508..10d97844e 100644 --- a/packages/core/src/components/tag/tag.tsx +++ b/packages/core/src/components/tag/tag.tsx @@ -1,4 +1,5 @@ import { Component, Host, Prop, h } from '@stencil/core' + import { IconProps } from '../../icons' @Component({ @@ -31,6 +32,7 @@ export class AtomTag { backgroundColor: this.getColor(this.customBackgroundColor), color: this.getColor(this.customTextColor), }} + part='tag' class='atom-tag' > {this.icon && (