Skip to content

Commit

Permalink
refactor: moved avatar attribute to the correct place fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puria committed Jan 27, 2024
1 parent eb106ad commit e816528
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/components/avatar/avatar.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
:host {
@apply inline-flex items-center justify-center relative overflow-hidden h-10 w-10 bg-accent rounded-full;
@apply inline-flex items-center justify-center relative overflow-hidden h-10 w-10 bg-accent rounded-full shrink-0;
}

:host span {
@apply text-on-accent
@apply text-on-accent;
}

:host([size="xs"]) svg,
:host([size="xs"]) {
:host([size='xs']) svg,
:host([size='xs']) {
@apply h-6 w-6 text-xs;
}

:host([size="s"]) svg,
:host([size="s"]) {
:host([size='s']) svg,
:host([size='s']) {
@apply h-8 w-8 text-sm;
}

:host([size="m"]) svg,
:host([size="m"]) {
:host([size='m']) svg,
:host([size='m']) {
@apply h-10 w-10;
}

:host([size="l"]) svg,
:host([size="l"]) {
:host([size='l']) svg,
:host([size='l']) {
@apply h-20 w-20 text-lg;
}

:host([size="xl"]) svg,
:host([size="xl"]) {
:host([size='xl']) svg,
:host([size='xl']) {
@apply h-36 w-36 text-xl;
}

:host([shape="round"]) {
:host([shape='round']) {
@apply rounded-full;
}

:host([shape="square"]) {
:host([shape='square']) {
@apply rounded-lg;
}

@include base-component();
@include base-component();
3 changes: 1 addition & 2 deletions src/components/credential-service/d-credential-service.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, Host, Prop, h } from '@stencil/core';
import 'material-symbols';

@Component({
tag: 'd-credential-service',
Expand All @@ -16,7 +15,7 @@ export class DCredentialService {
render() {
const content = (
<div>
<d-avatar class="shrink-0" name={this.name} src={this.logoSrc} size="l"></d-avatar>
<d-avatar name={this.name} src={this.logoSrc} size="l"></d-avatar>
<div class="grow truncate">
<span class="name">{this.name}</span>
<span class="description">{this.description}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('d-credential-service', () => {
<mock:shadow-root>
<div>
<d-avatar size="l"></d-avatar>
<div class="grow">
<div class="grow truncate">
<span class="name"></span>
<span class="description"></span>
<span class="issuer"></span>
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
extend: {
fontFamily: {
sans: ['"Gantari Variable"', 'sans-serif'],
icon: ['"Material Symbols Rounded"', 'sans-serif],
icon: ['"Material Symbols Rounded"'],
},
colors: {
'surface': 'var(--surface)',
Expand Down

0 comments on commit e816528

Please sign in to comment.