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

Merged
merged 37 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b8ae09b
Converted Avatar to css modules
Dec 11, 2024
dc2e233
Convert AvatarGroup
Dec 12, 2024
7c67045
Remove unused scss files
Dec 12, 2024
cfae404
Fix var() calls
Dec 12, 2024
b09a21c
Convert badge
Dec 12, 2024
e5484fb
remove unused scss file
Dec 12, 2024
2641e87
Convert brand
Dec 12, 2024
84ec773
Fix formatting
Dec 12, 2024
d115a4d
Convert BrandMoment, ButtonGroup
Dec 13, 2024
ab8913e
Remove lint disable
Dec 16, 2024
e17572a
Flattening
Dec 18, 2024
258b36f
Remove stylelint flags
Dec 18, 2024
860686f
Merge branch 'main' into KZN-2877/scss-to-css
Dec 18, 2024
f3d4288
Fix imports
Dec 18, 2024
9f729c9
Replace tshirt sizes and px literals with rem vars
Dec 19, 2024
5b86fc6
Replace font px literals with typography vars
Dec 19, 2024
ffe62e6
Add changeset
Dec 19, 2024
9394061
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Dec 19, 2024
99b4910
pr feedback
Dec 22, 2024
0311287
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Dec 22, 2024
623df05
PR feedback
Dec 23, 2024
c373c6a
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Dec 23, 2024
3f90b0c
Fix formatting
Dec 23, 2024
b91b8a2
Simplification
Dec 24, 2024
afb65f5
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Jan 5, 2025
36921e6
Badge fix
Jan 7, 2025
592b797
Linting
Jan 7, 2025
82c0c41
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Jan 7, 2025
736f37b
test
Jan 8, 2025
6fae2de
Fixed specificity
Jan 8, 2025
10f155f
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Jan 8, 2025
f6a78f0
Refix specificity
Jan 8, 2025
5d6e5f3
Fix specificity, simplify Avatar
Jan 9, 2025
f75cd11
Fix selectors, buttonGroup use css module
Jan 10, 2025
6bc6c8f
linting
Jan 10, 2025
6a8e862
Merge branch 'main' into KZN-2877/scss-to-css
Zystix Jan 12, 2025
56d9708
PR fixes
Jan 13, 2025
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
138 changes: 138 additions & 0 deletions packages/components/src/Avatar/Avatar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.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);
}

.small {
box-shadow: none;
border: none;

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

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

.small.company {
padding: 0;
}

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

.avatarImage.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: calc(var(--avatar-x-y) * 0.7);
}

.xlarge .fallbackIcon,
.xxlarge .fallbackIcon {
font-size: calc(var(--avatar-x-y) * 0.8);
}

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

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

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

.small .initials {
font-size: 0.5rem;
}

.small .initials,
.medium .initials {
margin-bottom: -1px;
font-weight: var(--typography-heading-5-font-weight);
letter-spacing: var(--typography-heading-5-letter-spacing);
}
169 changes: 0 additions & 169 deletions packages/components/src/Avatar/Avatar.module.scss

This file was deleted.

9 changes: 6 additions & 3 deletions 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 Expand Up @@ -153,14 +153,17 @@ export const Avatar = ({
isCompany && styles.company,
isPersonal && styles.personal,
isOtherUser && styles.otherUser,
(avatarState === 'loading' || avatarState === 'error') && styles.loading,
)}
{...restProps}
>
{avatarState !== 'none' && (
<img
ref={image}
className={classnames(styles.avatarImage, isCompany && styles.companyAvatarImage)}
className={classnames(
styles.avatarImage,
isCompany && styles.companyAvatarImage,
(avatarState === 'loading' || avatarState === 'error') && styles.loading,
)}
src={avatarSrc}
onError={onImageFailure}
onLoad={onImageSuccess}
Expand Down
Loading
Loading