Skip to content

Commit

Permalink
I'll explain this when I'm sober .. or revert it
Browse files Browse the repository at this point in the history
Signed-off-by: Sangam Kumar <[email protected]>
  • Loading branch information
sangamcse committed Nov 23, 2020
1 parent 60938fc commit 760b2e5
Show file tree
Hide file tree
Showing 14 changed files with 946 additions and 143 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
PURGE_CSS=true
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
PURGE_CSS=false
10 changes: 5 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
components: './src/components',
utils: './src/utils',
posts: './src/posts',
styles: './src/styles'
}
}
]
]
styles: './src/styles',
},
},
],
],
};
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const path = require('path');

module.exports = {
sassOptions: {
includePaths: [path.join(__dirname, 'styles')]
}
includePaths: [path.join(__dirname, 'styles')],
},
};
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"name": "portfolio",
"name": "sangam.dev",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev -p 3535",
"build": "next build",
"start": "next start",
"lint": "eslint --ext=js --fix src && stylelint src/styles/*.scss",
"precommit": "yarn lint"
"lint": "eslint --ext js --fix src && stylelint src/styles/*.scss"
},
"engineStrict": true,
"engines": {
"node": ">=12"
},
"dependencies": {
"@fullhuman/postcss-purgecss": "3.0.0",
"autoprefixer": "^10.0.2",
"next": "10.0.0",
"next-svgr": "0.0.2",
"postcss-preset-env": "6.7.0",
"prop-types": "15.7.2",
"react": "17.0.1",
"react-dom": "17.0.1",
"sass": "1.29.0",
Expand All @@ -34,8 +37,15 @@
"eslint-plugin-prettier": "3.0.1",
"eslint-plugin-react": "7.14.2",
"eslint-plugin-react-hooks": "1.4.0",
"husky": "4.3.0",
"prettier": "1.16.4",
"pretty-quick": "3.1.0",
"stylelint": "13.7.2",
"stylelint-config-standard": "20.0.0"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && pretty-quick --staged"
}
}
}
16 changes: 1 addition & 15 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
const path = require('path');

const purgecssConfig = [
'@fullhuman/postcss-purgecss',
{
content: [path.join(__dirname, 'src', '**', '*.{js,jsx}')],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
}
];

module.exports = {
plugins: [
'tailwindcss',
'postcss-preset-env',
...(process.env.PURGE_CSS ? [purgecssConfig] : [])
]
plugins: ['postcss-preset-env', 'tailwindcss', 'autoprefixer'],
};
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
};
2 changes: 1 addition & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Header() {
style={{
borderRight: '1px solid',
marginRight: '18px',
zIndex: 9999
zIndex: 9999,
}}
>
<ul className="flex items-center justify-start max-w-full mx-auto my-0 py-0 px-5 text-base list-none">
Expand Down
8 changes: 1 addition & 7 deletions src/components/SiteHead.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from 'next/head';
import PropTypes from 'prop-types';

function MyHead(props) {
const { pageName, children } = props;
Expand All @@ -22,14 +21,9 @@ function MyHead(props) {
);
}

MyHead.propTypes = {
pageName: PropTypes.string,
children: PropTypes.element
};

MyHead.defaultProps = {
pageName: 'Home',
children: null
children: null,
};

export default MyHead;
15 changes: 4 additions & 11 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/* purgecss start ignore */
@tailwind base;
@tailwind components;
@import './tailwind.scss';

/* purgecss end ignore */
@tailwind utilities;

/* purgecss start ignore */
.theme-light {
--color-primary: theme('colors.blue.700');
--color-primary-hover: theme('colors.blue.800');
Expand Down Expand Up @@ -88,15 +82,16 @@ html {
body {
margin: 0;
padding: 0;
font-family: DM Mono, -apple-system, BlinkMacSystemFont, roboto, segoe ui, Helvetica, Arial, sans-serif;
font-family: DM Mono, -apple-system, BlinkMacSystemFont, roboto, segoe ui,
Helvetica, Arial, sans-serif;
font-display: auto;
font-size: 1rem;
line-height: 1.54;
background-color: #fff;
color: #222;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
font-feature-settings: 'liga', 'tnum', 'case', 'calt', 'zero', 'ss01', 'locl';
-webkit-overflow-scrolling: touch;
-webkit-text-size-adjust: 100%;
display: flex;
Expand Down Expand Up @@ -145,5 +140,3 @@ body {
opacity: 0;
}
}

/* purgecss end ignore */
3 changes: 3 additions & 0 deletions src/styles/tailwind.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
8 changes: 4 additions & 4 deletions stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module.exports = {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['extends', 'tailwind']
}
ignoreAtRules: ['extends', 'tailwind'],
},
],
'block-no-empty': null,
'custom-property-empty-line-before': null,
'unit-allowed-list': ['em', 'rem', 's', 'px', '%', 'vh']
}
'unit-allowed-list': ['em', 'rem', 's', 'px', '%', 'vh'],
},
};
21 changes: 13 additions & 8 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const { fontFamily } = require('tailwindcss/defaultTheme');

module.exports = {
purge: {
mode: 'layers',
layers: ['components', 'utilities'],
content: ['./src/**/*.js'],
},
theme: {
fontFamily: {
mono: ['DM Mono', fontFamily.mono]
mono: ['DM Mono', fontFamily.mono],
},
extend: {
colors: {
Expand All @@ -29,21 +34,21 @@ module.exports = {
heading: 'var(--color-heading)',
'heading-muted': 'var(--color-heading-muted)',
body: 'var(--color-body)',
'body-muted': 'var(--color-body-muted)'
'body-muted': 'var(--color-body-muted)',
},
width: {
'max-content': 'max-content'
}
'max-content': 'max-content',
},
},
minWidth: {
'1/3': '33%'
}
'1/3': '33%',
},
},
variants: {
textColor: ['responsive', 'hover', 'focus', 'visited', 'group-hover'],
textDecoration: ['hover', 'focus', 'group-hover'],
opacity: ['responsive', 'hover', 'focus', 'group-hover'],
borderWidth: ['responsive', 'hover', 'focus']
borderWidth: ['responsive', 'hover', 'focus'],
},
plugins: []
plugins: [],
};
Loading

1 comment on commit 760b2e5

@vercel
Copy link

@vercel vercel bot commented on 760b2e5 Nov 23, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.