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

Replaced all the css into tailwind css on FontSection component #1784

Merged
merged 10 commits into from
Dec 14, 2023
Merged
11 changes: 8 additions & 3 deletions components/Branding/FontSection/FontSection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Content from 'components/Content/Content';
import { fontsObject } from 'common/styles/styleExports';
import styles from './FontSection.module.css';

function FontSection() {
// Every letter of the alphabet in one string
Expand All @@ -12,14 +11,20 @@ function FontSection() {
theme="gray"
hasTitleUnderline
columns={[
<ul className={styles.fontsList}>
<ul className="list-none w-full [&>li]:m-4">
{Object.keys(fontsObject).map(item => {
const fontStyle = {
fontFamily: fontsObject[item],
};
return (
<li key={item}>
<div>
<div
className={
fontsObject[item] === 'DIN Condensed Bold'
? '[&>p]:font-serif [&>h6]:font-serif [&>p]:font-primaryFontFamily [&>h6]:font-primaryFontFamily'
: '[&>p]:font-sans [&>p]:font-secondaryFontFamily [&>h6]:font-sans [&>h6]:font-secondaryFontFamily'
}
>
<h6 style={fontStyle}>{fontsObject[item]}</h6>
<p style={fontStyle}>{demoText}</p>
</div>
Expand Down
18 changes: 0 additions & 18 deletions components/Branding/FontSection/FontSection.module.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ exports[`FontSection should render with required props 1`] = `
columns={
Array [
<ul
className="fontsList"
className="list-none w-full [&>li]:m-4"
>
<li>
<div>
<div
className="[&>p]:font-serif [&>h6]:font-serif [&>p]:font-primaryFontFamily [&>h6]:font-primaryFontFamily"
>
<h6
style={
Object {
Expand All @@ -31,7 +33,9 @@ exports[`FontSection should render with required props 1`] = `
</div>
</li>
<li>
<div>
<div
className="[&>p]:font-sans [&>p]:font-secondaryFontFamily [&>h6]:font-sans [&>h6]:font-secondaryFontFamily"
>
<h6
style={
Object {
Expand Down
4 changes: 4 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module.exports = {
maxWidth: {
girderWidth: '700px',
},
fontFamily: {
primaryFontFamily: '"DIN Condensed Bold"',
secondaryFontFamily: '"Encode Sans"',
},
},
plugins: [
plugin(({ matchUtilities, theme }) => {
Expand Down