Skip to content

Commit

Permalink
feat(tailwind): remove all important styles (#909)
Browse files Browse the repository at this point in the history
* feat(tailwind): remove all `important` styles
* fix(tailwind): rectify broken tailwind styles

Keep tracking on vercel/next.js#16630.
  • Loading branch information
sabertazimi committed Jun 12, 2022
1 parent 064a920 commit 2ccb388
Show file tree
Hide file tree
Showing 48 changed files with 363 additions and 269 deletions.
6 changes: 3 additions & 3 deletions components/Article/ArticleHeader.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.header {
@apply bg-gradient-primary w-full bg-cover bg-center bg-no-repeat p-3 md:px-32 md:pt-48 md:pb-40 !important;
@apply bg-gradient-primary w-full bg-cover bg-center bg-no-repeat p-3 md:px-32 md:pt-48 md:pb-40;
}

.title {
@apply my-12 text-6xl text-light md:my-24 md:text-8xl !important;
h1.title {
@apply my-12 text-6xl text-light md:my-24 md:text-8xl;
}
48 changes: 24 additions & 24 deletions components/Article/__snapshots__/Article.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports[`Article should render correctly (snapshot) 1`] = `
</a>
</span>
<h1
class="ant-typography mdx-heading mb-6 dark:text-light title mt-48"
class="ant-typography mdx-heading dark:text-light heading title h1"
>
1 Basic Notes
</h1>
Expand Down Expand Up @@ -169,13 +169,13 @@ exports[`Article should render correctly (snapshot) 1`] = `
>
<article>
<h2
class="ant-typography mdx-heading mb-6 dark:text-light mt-24"
class="ant-typography mdx-heading dark:text-light heading h2"
>
1 Basic Notes
</h2>
</article>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center mx-0 my-12 leading-relaxed tracking-wide font-extrabold dark:border-light dark:text-light"
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center divider dark:border-light dark:text-light"
role="separator"
>
<span
Expand Down Expand Up @@ -249,7 +249,7 @@ exports[`Article should render correctly (snapshot) 1`] = `
</div>
</div>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center mx-0 my-12 leading-relaxed tracking-wide font-extrabold dark:border-light dark:text-light"
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center divider dark:border-light dark:text-light"
role="separator"
>
<span
Expand Down Expand Up @@ -295,14 +295,14 @@ exports[`Article should render correctly (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://twitter.com/intent/tweet?url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(29, 161, 242);"
>
<span
aria-label="twitter"
class="anticon anticon-twitter text-4xl"
class="anticon anticon-twitter icon"
role="img"
>
<svg
Expand Down Expand Up @@ -331,14 +331,14 @@ exports[`Article should render correctly (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://www.facebook.com/sharer.php?u=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(24, 119, 242);"
>
<span
aria-label="facebook"
class="anticon anticon-facebook text-4xl"
class="anticon anticon-facebook icon"
role="img"
>
<svg
Expand Down Expand Up @@ -367,14 +367,14 @@ exports[`Article should render correctly (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://www.linkedin.com/shareArticle?mini=true&url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(10, 102, 194);"
>
<span
aria-label="linkedin"
class="anticon anticon-linkedin text-4xl"
class="anticon anticon-linkedin icon"
role="img"
>
<svg
Expand Down Expand Up @@ -402,14 +402,14 @@ exports[`Article should render correctly (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://service.weibo.com/share/share.php?url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(230, 22, 45);"
>
<span
aria-label="weibo"
class="anticon anticon-weibo text-4xl"
class="anticon anticon-weibo icon"
role="img"
>
<svg
Expand Down Expand Up @@ -455,7 +455,7 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
</a>
</span>
<h1
class="ant-typography mdx-heading mb-6 dark:text-light title mt-48"
class="ant-typography mdx-heading dark:text-light heading title h1"
>
1 Basic Notes
</h1>
Expand Down Expand Up @@ -584,13 +584,13 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
>
<article>
<h2
class="ant-typography mdx-heading mb-6 dark:text-light mt-24"
class="ant-typography mdx-heading dark:text-light heading h2"
>
1 Basic Notes
</h2>
</article>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center mx-0 my-12 leading-relaxed tracking-wide font-extrabold dark:border-light dark:text-light"
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center divider dark:border-light dark:text-light"
role="separator"
>
<span
Expand Down Expand Up @@ -664,7 +664,7 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
</div>
</div>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center mx-0 my-12 leading-relaxed tracking-wide font-extrabold dark:border-light dark:text-light"
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-center divider dark:border-light dark:text-light"
role="separator"
>
<span
Expand Down Expand Up @@ -710,14 +710,14 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://twitter.com/intent/tweet?url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(29, 161, 242);"
>
<span
aria-label="twitter"
class="anticon anticon-twitter text-4xl"
class="anticon anticon-twitter icon"
role="img"
>
<svg
Expand Down Expand Up @@ -746,14 +746,14 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://www.facebook.com/sharer.php?u=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(24, 119, 242);"
>
<span
aria-label="facebook"
class="anticon anticon-facebook text-4xl"
class="anticon anticon-facebook icon"
role="img"
>
<svg
Expand Down Expand Up @@ -782,14 +782,14 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://www.linkedin.com/shareArticle?mini=true&url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(10, 102, 194);"
>
<span
aria-label="linkedin"
class="anticon anticon-linkedin text-4xl"
class="anticon anticon-linkedin icon"
role="img"
>
<svg
Expand Down Expand Up @@ -817,14 +817,14 @@ exports[`Article should render correctly with partial data (snapshot) 1`] = `
style="opacity: 0; transform: translateX(20px) translateZ(0);"
>
<a
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only rounded-none text-center text-light"
class="ant-btn ant-btn-link ant-btn-lg ant-btn-icon-only button"
href="https://service.weibo.com/share/share.php?url=https://blog.tazimi.dev/post/1BasicNotes"
role="link"
style="background-color: rgb(230, 22, 45);"
>
<span
aria-label="weibo"
class="anticon anticon-weibo text-4xl"
class="anticon anticon-weibo icon"
role="img"
>
<svg
Expand Down
14 changes: 7 additions & 7 deletions components/Aside/Aside.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
@apply mt-0 mb-9;
}

.admonition div,
.admonition[role='alert'] div,
.admonition ol,
.admonition ul {
@apply mb-3 !important;
@apply mb-3;
}

.admonition ol li::before {
@apply mr-1 !important;
@apply mr-1;
}

.admonition div:last-child,
.admonition ol:last-child,
.admonition ul:last-child,
.admonition li {
@apply my-0 !important;
.admonition[role='alert'] li {
@apply my-0;
}

.admonition code {
@apply text-sm !important;
.admonition[role='alert'] code {
@apply text-sm;
}
10 changes: 10 additions & 0 deletions components/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
.ant-btn-text {
@apply dark:text-light;
}

.ant-btn-default,
.ant-btn-dashed {
@apply bg-transparent hover:bg-transparent dark:text-light dark:hover:text-secondary;
}

/* Remove tailwind button reset styles */
.ant-btn-primary {
@apply bg-primary;
}
9 changes: 4 additions & 5 deletions components/CodeBlocks/InlineCode.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.code {
/* Add `!important` to override `antd` styles */
@apply break-words border border-solid border-secondary bg-transparent box-decoration-clone px-1.5 py-px !important;
@apply font-mono font-normal leading-6 text-dark shadow-xl !important;
code.code {
@apply break-words border border-solid border-secondary bg-transparent box-decoration-clone px-1.5 py-px;
@apply font-mono font-normal leading-6 text-dark shadow-xl;

font-size: var(--font-size) !important;
font-size: var(--font-size);
}
7 changes: 7 additions & 0 deletions components/Divider/Divider.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.divider {
@apply leading-relaxed tracking-wide;
}

.divider[role='separator'] {
@apply mx-0 my-12 font-extrabold;
}
13 changes: 11 additions & 2 deletions components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { cx } from '@components/utils';
import type { DividerProps } from 'antd';
import { Divider as AntDivider } from 'antd';
import styles from './Divider.module.css';

interface Props extends DividerProps {}

const Divider = ({
type = 'horizontal',
className = 'mx-0 my-12 leading-relaxed tracking-wide font-extrabold dark:border-light dark:text-light',
className,
children,
}: Props): JSX.Element => (
<AntDivider type={type} className={className}>
<AntDivider
type={type}
className={cx(
styles.divider,
className,
'dark:border-light dark:text-light'
)}
>
{children}
</AntDivider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports[`ErrorBoundary should render alert message correctly (snapshot) 1`] = `
role="alert"
>
<div
class="ant-typography mt-0 mb-9 leading-relaxed tracking-wide dark:text-light"
class="ant-typography p dark:text-light"
>
<span
class="ant-typography text-xl font-extrabold dark:text-light"
Expand All @@ -49,7 +49,7 @@ exports[`ErrorBoundary should render alert message correctly (snapshot) 1`] = `
</span>
</div>
<div
class="ant-typography mt-0 mb-9 leading-relaxed tracking-wide dark:text-light"
class="ant-typography p dark:text-light"
>
<span
class="ant-typography dark:text-light"
Expand All @@ -58,7 +58,7 @@ exports[`ErrorBoundary should render alert message correctly (snapshot) 1`] = `
</span>
</div>
<div
class="ant-typography mt-0 mb-9 leading-relaxed tracking-wide dark:text-light"
class="ant-typography p dark:text-light"
>
<span
class="ant-typography dark:text-light"
Expand All @@ -67,7 +67,7 @@ exports[`ErrorBoundary should render alert message correctly (snapshot) 1`] = `
</span>
</div>
<div
class="ant-typography mt-0 mb-9 leading-relaxed tracking-wide dark:text-light"
class="ant-typography p dark:text-light"
>
<span
class="ant-typography dark:text-light"
Expand Down
10 changes: 6 additions & 4 deletions components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@ const Footer = ({
))}
</Col>
</Row>
<Divider className="my-12 border-light" />
<Divider className="border-light" />
<Row align="middle" justify="center">
<Col span={24}>
<Col className="mx-6">
<span>
Copyright &copy;{' '}
<a href={`https://github.com/${socials.github}`}>{author}</a>{' '}
</span>
<Divider type="vertical" className="border-light" />
</Col>
<Col className="mx-6">
<span>
Built with <a href="https://reactjs.org">React</a> and{' '}
<a href="https://nextjs.org">Next</a>
</span>
<Divider type="vertical" className="border-light" />
</Col>
<Col className="mx-6">
<span>
Last Built Time{' '}
<a href="https://www.google.com/search?q=time">
Expand Down
Loading

1 comment on commit 2ccb388

@vercel
Copy link

@vercel vercel bot commented on 2ccb388 Jun 12, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

blog – ./

blog-git-main-sabertaz.vercel.app
blog.tazimi.dev
blog-sabertaz.vercel.app

Please sign in to comment.