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 23 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
146 changes: 146 additions & 0 deletions packages/components/src/Avatar/Avatar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
.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);
box-shadow: var(--shadow-small-box-shadow);
border: 3px solid var(--color-white);
}

Zystix marked this conversation as resolved.
Show resolved Hide resolved
.wrapper.small {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha oh no! I must not have been clear enough. Here's an example:

Suggested change
.wrapper.small {
.small {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

box-shadow: none;
border: none;

--avatar-x-y: 1.25rem;
}

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

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

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

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

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

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

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

.wrapper .xxlarge {
--avatar-x-y: 7.75rem;
}

.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);
}

.initials.longName::before {
content: none;
}

.initials::before {
content: '';
display: block;
margin-top: -0.001em;
}

.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 .xlarge .initials,
.wrapper .xxlarge .initials {
font-size: var(--typography-heading-1-font-size);
letter-spacing: var(--typography-heading-1-letter-spacing);
}

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

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

.wrapper.small,
.wrapper.medium .initials {
margin-bottom: -1px;
}
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
60 changes: 60 additions & 0 deletions packages/components/src/AvatarGroup/AvatarGroup.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.AvatarGroup {
display: inline-flex;
list-style: none;
margin: 0;
padding: 0;
}

.AvatarCounter {
direction: ltr;
align-items: center;
background: var(--color-gray-300);
border: 3px solid var(--color-white);
border-radius: 100%;
box-sizing: border-box;
box-shadow: var(--shadow-small-box-shadow);
display: flex;
justify-content: center;
overflow: hidden;
width: var(--avatar-x-y, 1.25rem);
height: var(--avatar-x-y, 1.25rem);
}

.AvatarGroupItem + .AvatarGroupItem {
margin-inline-start: calc((var(--avatar-x-y)) / -2);
}

.small {
--avatar-x-y: 1.25rem;

.AvatarCounter {
box-shadow: none;
border: none;
font-family: var(--typography-heading-5-font-family);
font-size: 0.5rem;
font-weight: var(--typography-heading-5-font-weight);
letter-spacing: var(--typography-heading-5-letter-spacing);
}
}

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

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

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

.AvatarCounter {
font-family: var(--typography-heading-3-font-family);
font-size: var(--typography-heading-3-font-size);
font-weight: var(--typography-heading-3-font-weight);
letter-spacing: var(--typography-heading-3-letter-spacing);
}
}
Loading
Loading