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

feat: text and fill divider classes #81

Merged
merged 2 commits into from
Oct 10, 2023
Merged
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
49 changes: 49 additions & 0 deletions packages/vanilla/src/components/typography/divider.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export default {
title: 'Patterns/Divider',
argTypes: {
title: {
name: 'Divider Title',
description: 'Title of the divider',
control: 'text'
},
dividerLevel: {
name: 'Divider Level',
description: 'Select a divider level',
control: 'select',
options: ['xl', 'lg', 'md', 'sm', 'xs']
},
headingLevel: {
name: 'Heading Level',
description: 'Select a heading level',
control: 'select',
options: ['h2', 'h3', 'h4', 'h5', 'h6']
}
},
};

const DividerTemplate = ({ title, dividerLevel, headingLevel }) => {
return `
<${headingLevel} class="cbp-divider-text cbp-divider-text--${dividerLevel}">${title}</${headingLevel}>
`;
};

const DividerFillTemplate = ({ title, dividerLevel, headingLevel }) => {
return `
<${headingLevel} class="cbp-divider-fill cbp-divider-fill--${dividerLevel}">${title}</${headingLevel}>
`;
};

export const Text = DividerTemplate.bind({});
Text.args = {
title: 'Example Text Divider',
dividerLevel: 'xl',
headingLevel: 'h2'
};

export const Fill = DividerFillTemplate.bind({});
Fill.args = {
title: 'Example Text Divider w/ Fill',
dividerLevel: 'xl',
headingLevel: 'h2'
};
Fill.storyName = "Text w/ Fill";
62 changes: 62 additions & 0 deletions packages/vanilla/src/sass/typography/_dividers.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.cbp-divider-text {
border-bottom-color: var(--cbp-color-gray-cool-30);
border-bottom-style: solid;
border-bottom-width: var(--cbp-border-size-md);
color: var(--cbp-color-text-darker);
font-weight: var(--cbp-font-weight-regular);
padding: var(--cbp-space-3x) var(--cbp-space-3x) var(--cbp-space-3x) 0;
}

.cbp-divider-fill {
background-color: var(--cbp-color-gray-cool-10);
border-radius: var(--cbp-border-radius-soft);
color: var(--cbp-color-text-darker);
font-size: var(--cbp-font-size-heading-xl);
font-weight: var(--cbp-font-weight-regular);
padding: var(--cbp-space-3x);
}

.cbp-divider-text--xl,
.cbp-divider-fill--xl {
font-size: var(--cbp-font-size-heading-xl);
}

.cbp-divider-text--lg,
.cbp-divider-fill--lg {
font-size: var(--cbp-font-size-heading-lg);
}

.cbp-divider-text--md,
.cbp-divider-fill--md {
font-size: var(--cbp-font-size-heading-md);
font-weight: var(--cbp-font-weight-medium);
padding-top: var(--cbp-space-2x);
padding-bottom: var(--cbp-space-2x);
}

.cbp-divider-text--sm,
.cbp-divider-fill--sm {
font-size: var(--cbp-font-size-heading-sm);
font-weight: var(--cbp-font-weight-medium);
padding-top: var(--cbp-space-1x);
padding-bottom: var(--cbp-space-1x);
}

.cbp-divider-text--sm {
border-bottom-width: var(--cbp-border-size-sm);
}

.cbp-divider-text--xs {
border-bottom-width: var(--cbp-border-size-sm);
font-size: var(--cbp-font-size-heading-xs);
font-weight: var(--cbp-font-weight-bold);
padding-top: var(--cbp-space-1x);
padding-bottom: var(--cbp-space-1x);
padding-right: var(--cbp-space-2x);
}

.cbp-divider-fill--xs {
font-size: var(--cbp-font-size-heading-xs);
font-weight: var(--cbp-font-weight-bold);
padding: var(--cbp-space-1x) var(--cbp-space-2x);
}
1 change: 1 addition & 0 deletions packages/vanilla/src/sass/typography/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use './fonts';
@use 'dividers';

@use './font-face/roboto';
@use './font-face/roboto-italic';