Skip to content

Commit

Permalink
feat(mantine): remove a lot of custom style to get a vanilla style
Browse files Browse the repository at this point in the history
  • Loading branch information
GermainBergeron committed Dec 17, 2024
1 parent 34f8056 commit 25cedec
Show file tree
Hide file tree
Showing 30 changed files with 210 additions and 379 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
box-shadow: var(--mantine-shadow-md);
border-radius: var(--mantine-radius-default);
border: 1px solid;
border-color: var(--mantine-color-gray-3);
border-color: var(--mantine-color-default-border);
flex: 1;
}

Expand Down
9 changes: 2 additions & 7 deletions packages/mantine/src/components/header/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
}

& .description {
color: var(--mantine-color-gray-6);
color: var(--mantine-color-dimmed);
font-weight: 300;
}
}

.title {
word-break: break-word;

&[data-variant='primary'] {
color: var(--mantine-color-gray-5);
}

line-height: var(--mantine-line-height-md);
}

Expand All @@ -31,5 +26,5 @@
}

.breadcrumbsSeparator {
color: var(--mantine-color-gray-5);
color: var(--mantine-color-dimmed);
}
11 changes: 4 additions & 7 deletions packages/mantine/src/components/prompt/Prompt.module.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
.root {
--prompt-icon-size: 88px;
--prompt-icon-size: 68px;

.header {
border-bottom: none;
align-items: center;
}

.body {
padding: 0 var(--mantine-spacing-lg) var(--mantine-spacing-lg)
calc(var(--prompt-icon-size) + (2 * var(--mantine-spacing-lg)));
calc(var(--prompt-icon-size) + var(--mantine-spacing-md) + var(--mantine-spacing-lg));
}
}

Expand All @@ -18,10 +17,8 @@
}

.header {
gap: var(--mantine-spacing-lg);
gap: var(--mantine-spacing-md);
width: 100%;
font-size: var(--mantine-h3-font-size);
line-height: var(--mantine-h3-line-height);
overflow-wrap: anywhere;
padding: var(--mantine-spacing-lg) var(--mantine-spacing-md) var(--mantine-spacing-xs) var(--mantine-spacing-lg);
}
Expand All @@ -31,5 +28,5 @@
}

.inner {
color: var(--mantine-color-gray-7);
color: var(--mantine-color-dimmed);
}
2 changes: 1 addition & 1 deletion packages/mantine/src/components/prompt/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const Prompt = factory<PromptFactory>((_props, ref) => {

return (
<PromptContextProvider value={{variant, getStyles}}>
<Modal.Root ref={ref} variant="prompt" size="sm" {...others} {...getStyles('root')}>
<Modal.Root ref={ref} variant="prompt" size="lg" {...others} {...getStyles('root')}>
<Modal.Overlay {...getStyles('overlay', stylesApiProps)} />
<Modal.Content {...getStyles('content', stylesApiProps)}>
<Modal.Header {...getStyles('header', stylesApiProps)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export type PromptConfirmButtonFactory = Factory<{
}>;

const COLOR_BY_VARIANT: Record<PromptVariant, string> = {
success: 'action',
info: 'action',
warning: 'critical',
critical: 'critical',
success: 'var(--mantine-primary-color-filled)',
info: 'var(--mantine-primary-color-filled)',
warning: 'var(--mantine-color-error)',
critical: 'var(--mantine-color-error)',
};

const defaultProps: Partial<PromptConfirmButtonProps> = {};
Expand Down
6 changes: 0 additions & 6 deletions packages/mantine/src/styles/ActionIcon.module.css

This file was deleted.

27 changes: 1 addition & 26 deletions packages/mantine/src/styles/Alert.module.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
.root {
padding: var(--mantine-spacing-sm);

&:not(&[data-variant]) {
/* TODO: Plasma Reset, validate if we need the border */
border-color: color-mix(in srgb, var(--alert-color), var(--alert-bg) 85%);
}
}

.wrapper {
gap: var(--mantine-spacing-sm);
}

.title {
font-weight: 500;
}

.icon {
width: 16px;
height: 16px;
margin-right: 0;
}

.message {
@mixin light {
color: var(--mantine-color-gray-7);

&:where([data-variant='filled']) {
color: var(--alert-color);
}
}

&:where([data-variant='white']) {
color: var(--mantine-color-black);
}
}
6 changes: 0 additions & 6 deletions packages/mantine/src/styles/Anchor.module.css

This file was deleted.

3 changes: 0 additions & 3 deletions packages/mantine/src/styles/AppShellNavBar.module.css

This file was deleted.

2 changes: 0 additions & 2 deletions packages/mantine/src/styles/Badge.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.root {
text-transform: none;
padding: var(--mantine-spacing-xxs) var(--mantine-spacing-xs);
font-weight: 500;
}
17 changes: 0 additions & 17 deletions packages/mantine/src/styles/Checkbox.module.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
.label {
font-size: var(--mantine-font-size-sm);
font-weight: 300;
}

.input {
&[data-indeterminate] {
background-color: var(--mantine-color-pureWhite);
border-color: var(--mantine-color-gray-4);

& + svg {
color: var(--mantine-color-gray-6);
}
}

&[readonly] {
background-color: var(--mantine-color-gray-2);
border-color: var(--mantine-color-gray-2);
}
}
4 changes: 2 additions & 2 deletions packages/mantine/src/styles/Combobox.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.search {
margin: 0 0 var(--mantine-spacing-xs);
border-radius: var(--mantine-radius-md);
border-radius: var(--mantine-radius-default);
border: 1px solid;
width: 100%;
border-color: var(--mantine-color-gray-4);
border-color: var(--mantine-color-default-border);

&:focus {
border-color: var(--mantine-primary-color-filled);
Expand Down
3 changes: 0 additions & 3 deletions packages/mantine/src/styles/DatePicker.module.css

This file was deleted.

3 changes: 0 additions & 3 deletions packages/mantine/src/styles/Input.module.css

This file was deleted.

54 changes: 1 addition & 53 deletions packages/mantine/src/styles/Modal.module.css
Original file line number Diff line number Diff line change
@@ -1,60 +1,8 @@
.root {
&[data-full-screen] {
.content {
flex: 0 0 100%;
}
}

&[data-size='xs'] {
.content {
flex: 0 0 rem(432px);
}
}

&[data-size='sm'] {
.content {
flex: 0 0 rem(664px);
}
}

&[data-size='md'] {
.content {
flex: 0 0 rem(896px);
}
}

&[data-size='lg'] {
.content {
flex: 0 0 rem(1120px);
}
}

&[data-size='xl'] {
.content {
flex: 0 0 rem(88%);
}
}

&:not([data-size]) {
.content {
flex: 0 0 rem(896px);
}
}
}

.content {
overflow: auto;
}

.header {
border-bottom: 1px solid var(--mantine-color-gray-3);
align-items: flex-start;
border-bottom: 1px solid var(--mantine-color-default-border);
}

.title {
width: 100%;
font-size: var(--mantine-h3-font-size);
line-height: var(--mantine-h3-line-height);
font-weight: 500;
}

Expand Down
18 changes: 0 additions & 18 deletions packages/mantine/src/styles/NavLink.module.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
.root {
color: var(--mantine-color-gray-6);
line-height: var(--mantine-line-height);
border-radius: var(--mantine-radius-default) 0 0 var(--mantine-radius-default);

&[data-active] {
color: var(--mantine-primary-color-6);
}

@mixin hover {
@mixin light {
&:where(:not([data-active])) {
background-color: var(--mantine-color-gray-1);
}
}
}
}

.label {
font-weight: 500;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/styles/Notification.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.root {
border-color: var(--mantine-color-gray-3);
border-color: var(--mantine-color-default-border);
background-color: var(--mantine-color-gray-0);
box-shadow: var(--mantine-shadow-lg);
padding: var(--mantine-spacing-sm);
Expand Down
30 changes: 0 additions & 30 deletions packages/mantine/src/styles/Pagination.module.css

This file was deleted.

6 changes: 0 additions & 6 deletions packages/mantine/src/styles/Radio.module.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
.labelWrapper {
display: flex;
align-items: flex-start;

&:not([data-disabled]) {
.label {
color: var(--mantine-color-gray-7);
}
}
}
6 changes: 3 additions & 3 deletions packages/mantine/src/styles/ReadOnlyInput.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cursor: text;

--input-bd: transparent;
--input-bg: var(--mantine-color-gray-2);
--input-color: var(--mantine-color-gray-7);
--input-placeholder-color: var(--mantine-color-gray-7);
--input-bg: var(--mantine-color-dark-light);
--input-color: var(--mantine-color-dimmed);
--input-placeholder-color: var(--mantine-color-dimmed);
}
32 changes: 0 additions & 32 deletions packages/mantine/src/styles/SegmentedControl.module.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
.root {
background-color: var(--mantine-color-gray-2);
}

.indicator {
border-radius: var(--sc-radius, var(--mantine-radius-sm));
}

.label {
font-weight: 300;

@mixin light {
color: var(--mantine-color-gray-6);
}

&:where([data-disabled]) {
@mixin light {
color: var(--mantine-color-gray-5);
}
}

&:where([data-active]) {
@mixin light {
color: var(--sc-label-color, var(--mantine-color-black));
}
}

&:where(:not([data-disabled], [data-active], [data-read-only])) {
@mixin hover {
@mixin light {
color: var(--mantine-color-black);
}
}
}
}
Loading

0 comments on commit 25cedec

Please sign in to comment.