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

WIP: !feat: indents (#133) #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/blocks/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const Layout = ({
fullWidth,
mobileOrder,
children,
paddingTop = 'xs',
paddingBottom = 'xs',
paddingTop = '0',
paddingBottom = '0',
}: PropsWithChildren<LayoutProps>) => {
const layout: LayoutType = useMemo(() => {
const layoutConfig: LayoutType = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Wrapper/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Wrapper: React.FunctionComponent<WrapperProps> = ({
<section
className={b(
{
['padding-top']: paddings?.top || 'xs',
['padding-top']: paddings?.top || '0',
['padding-bottom']: paddings?.bottom || 'l',
['padding-left']: paddings?.left || '',
['padding-right']: paddings?.right || '',
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ export enum BlogMetrikaGoalIds {

export const DEFAULT_PADDINGS: Paddings = {
[PaddingsDirections.bottom]: 'l',
[PaddingsDirections.top]: 'xs',
[PaddingsDirections.top]: '0',
};
2 changes: 1 addition & 1 deletion src/models/paddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export enum PaddingsDirections {
right = 'right',
}

export type PaddingSize = 'xs' | 's' | 'm' | 'l' | 'xl';
export type PaddingSize = '0' | 'xs' | 's' | 'm' | 'l' | 'xl';

export type Paddings = {
[key in PaddingsDirections]?: PaddingSize;
Expand Down
16 changes: 12 additions & 4 deletions styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

@mixin paddings() {
&_padding-top {
&_0 {
padding-top: 0;
}

&_xs {
padding-top: 0px;
padding-top: $indentXS;
}

&_s {
padding-top: $indentXS;
padding-top: $indentSM;
}

&_m {
Expand All @@ -26,12 +30,16 @@
}

&_padding-bottom {
&_0 {
padding-bottom: 0;
}

&_xs {
padding-bottom: 0px;
padding-bottom: $indentXS;
}

&_s {
padding-bottom: $indentXS;
padding-bottom: $indentSM;
}

&_m {
Expand Down
2 changes: 1 addition & 1 deletion test-utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {PaddingSize} from '../src/models/paddings';

export const PADDING_SIZES: PaddingSize[] = ['xs', 's', 'm', 'l', 'xl'];
export const PADDING_SIZES: PaddingSize[] = ['0', 'xs', 's', 'm', 'l', 'xl'];

export const ERROR_INPUT_DATA_MESSAGE = 'There are errors in input test data';
Loading