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

Initial Conversion of SCSS to CSS #5375

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 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
5 changes: 5 additions & 0 deletions .changeset/lazy-toes-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kaizen/components': patch
---

Initial conversion of SCSS to CSS
152 changes: 152 additions & 0 deletions packages/components/src/Avatar/Avatar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
.wrapper {
--avatar-x-y: 1.5rem;

background: var(--color-gray-300);
border-radius: 100%;
box-sizing: border-box;
overflow: hidden;
align-items: center;
display: flex;
justify-content: center;
width: var(--avatar-x-y);
height: var(--avatar-x-y);

Zystix marked this conversation as resolved.
Show resolved Hide resolved
&:not(.small) {
box-shadow: var(--shadow-small-box-shadow);
border: 3px solid var(--color-white);
}

/* Themes */
&.personal {
background: var(--color-orange-100);
}

&.otherUser {
background: var(--color-gray-300);
}

&.company {
border: 0;
background: var(--color-white);
padding: var(--spacing-6);
border-radius: var(--border-solid-border-radius);
}

/* Sizes */
&.small {
--avatar-x-y: 1.25rem;
}

&.small &.company {
padding: 0;
}

&.medium {
--avatar-x-y: 3rem;
}

&.large {
--avatar-x-y: 4.5rem;
}

&.xlarge {
--avatar-x-y: 6rem;
}

&.xxlarge {
--avatar-x-y: 7.75rem;
}
Zystix marked this conversation as resolved.
Show resolved Hide resolved
}

.avatarImage {
width: 100%;
height: 100%;
object-fit: cover;

.loading & {
display: none;
}
}

.companyAvatarImage {
object-fit: contain;
box-sizing: border-box;
border-radius: var(--spacing-4);
}

.fallbackIcon {
color: rgba(var(--color-purple-800-rgb), 0.7);
font-size: var(--avatar-fallback-icon-size);

.xlarge &,
.xxlarge & {
--avatar-fallback-icon-size: calc(var(--avatar-x-y) * 0.8);
}

.small &,
.medium &,
.large & {
--avatar-fallback-icon-size: calc(var(--avatar-x-y) * 0.7);
}
}

.initials {
box-sizing: border-box;
color: var(--color-purple-800);
padding-left: 5px;
padding-right: 5px;
text-align: center;
width: 100%;
font-size: var(--typography-heading-3-font-size);
font-family: var(--typography-heading-1-font-family);
font-weight: var(--typography-heading-1-font-weight);
letter-spacing: var(--typography-heading-3-letter-spacing);

/* Whitespace cropping */
&:not(.longName)::before {
content: '';
display: block;
margin-top: -0.001em;
}

.xlarge &,
.xxlarge & {
font-size: var(--typography-heading-1-font-size);
letter-spacing: var(--typography-heading-1-letter-spacing);
}

.medium & {
font-size: var(--typography-heading-5-font-size);
font-weight: var(--typography-heading-5-font-weight);
letter-spacing: var(--typography-heading-5-letter-spacing);
}

.small & {
font-size: 0.5rem;
font-weight: var(--typography-heading-5-font-weight);
letter-spacing: var(--typography-heading-5-letter-spacing);
}
}

.wrapper & .initials {
text-decoration: none;
speak-as: spell-out;

/* to override materialize.css global styling in performance-ui,
* which sets a border-bottom on abbr tags
*/
border-bottom: none;
}

.wrapper &.small .initials {
margin-bottom: -1px;
}

.wrapper &.medium {
width: var(--avatar-x-y);
height: var(--avatar-x-y);

.initials {
margin-bottom: -1px;
}
}
Zystix marked this conversation as resolved.
Show resolved Hide resolved
169 changes: 0 additions & 169 deletions packages/components/src/Avatar/Avatar.module.scss

This file was deleted.

2 changes: 1 addition & 1 deletion packages/components/src/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classnames from 'classnames'
import { Textfit } from 'react-textfit'
import { Icon } from '~components/__rc__/Icon'
import { type OverrideClassName } from '~components/types/OverrideClassName'
import styles from './Avatar.module.scss'
import styles from './Avatar.module.css'

export type AvatarSizes = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'

Expand Down
Loading
Loading