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
3 changes: 1 addition & 2 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,7 +11,7 @@ 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],
Expand Down
9 changes: 0 additions & 9 deletions components/Branding/FontSection/FontSection.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
.fontsList {
list-style: none;
width: 100%;
}

.fontsList > li {
margin: 1rem;
}

.primaryFontFamily div > h6,
.primaryFontFamily div > p {
Copy link
Contributor Author

@subhajit20 subhajit20 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find these two classes. @kylemh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can apply them directly on L22 and L23

font-family: var(--primaryFontFamily), sans-serif;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job on the condition.

Do you see here how it's 2 values separated by a comma?

  1. var(--primaryFontFamily)
  2. sans-serif

That's what's missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where to set that variable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the tailwind config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will it look like this ? ->
fontFamily:{
sans:{
primaryFontFamily:'"DIN Condensed Bold"'
}
}

Copy link
Member

@kylemh kylemh Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fontFamily: {
  primary: "DIN Condensed Bold"
},

and then you can use font-primary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done certain changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`FontSection should render with required props 1`] = `
columns={
Array [
<ul
className="fontsList"
className="list-none w-full [&>li]:m-4"
>
<li>
<div>
Expand Down