├── .babelrc ├── .gitignore ├── README.md ├── assets └── antd-custom.less ├── components └── Textbox.js ├── next.config.js ├── now.json ├── package.json ├── pages ├── _document.js └── index.js ├── static └── images │ ├── big-images-2.jpg │ ├── big-images-3.jpg │ ├── big-images.jpg │ ├── burger1.jpg │ ├── burger2.jpg │ ├── burger3.jpg │ ├── burger4.jpg │ └── section-1.png └── style.less /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["next/babel"], 3 | "plugins": [ 4 | [ 5 | "import", { 6 | "libraryName": "antd", 7 | "style": true 8 | }, 9 | ] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .next 4 | .vscode 5 | build 6 | coverage 7 | node_modules 8 | npm-debug* 9 | out 10 | yarn-debug* 11 | yarn-error* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project we created a simple project with Nextjs and use Ant Design for CSS components and also deploy that with Now.sh 2 | 3 | https://nextjs-antd-custom.autsakorn.now.sh 4 | -------------------------------------------------------------------------------- /assets/antd-custom.less: -------------------------------------------------------------------------------- 1 | @primary-color: #ff4c3b; 2 | 3 | @layout-header-height: 51px; 4 | @layout-header-padding : 0px 0px; 5 | @layout-header-background : #f8f8f8; 6 | @layout-body-background: #ffffff; 7 | @layout-footer-padding : 0px; 8 | 9 | @border-radius-base: 2px; 10 | 11 | @collapse-content-bg: #ffffff; 12 | -------------------------------------------------------------------------------- /components/Textbox.js: -------------------------------------------------------------------------------- 1 | export default () => ( 2 |
3 | ); 4 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | const { PHASE_PRODUCTION_SERVER } = 2 | process.env.NODE_ENV === 'development' 3 | ? {} // We're never in "production server" phase when in development mode 4 | : !process.env.NOW_REGION 5 | ? require('next/constants') // Get values from `next` package when building locally 6 | : require('next-server/constants'); // Get values from `next-server` package when building on now v2 7 | 8 | module.exports = (phase, { defaultConfig }) => { 9 | if (phase === PHASE_PRODUCTION_SERVER) { 10 | // Config used to run in production. 11 | return {}; 12 | } 13 | 14 | /* eslint-disable */ 15 | const withLess = require('@zeit/next-less') 16 | const lessToJS = require('less-vars-to-js') 17 | const fs = require('fs') 18 | const path = require('path') 19 | 20 | // Where your antd-custom.less file lives 21 | const themeVariables = lessToJS( 22 | fs.readFileSync(path.resolve(__dirname, './assets/antd-custom.less'), 'utf8') 23 | ) 24 | 25 | // fix: prevents error when .less files are required by node 26 | if (typeof require !== 'undefined') { 27 | require.extensions['.less'] = file => {} 28 | } 29 | 30 | return withLess({ 31 | lessLoaderOptions: { 32 | javascriptEnabled: true, 33 | modifyVars: themeVariables // make your antd custom effective 34 | } 35 | }) 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { "src": "package.json", "use": "@now/next" } 5 | ] 6 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nextjs-antd-custom", 3 | "version": "1.0.0", 4 | "author": "autsakorn", 5 | "scripts": { 6 | "dev": "next", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "antd": "^3.12.1", 12 | "babel-plugin-import": "^1.7.0", 13 | "less": "^2.7.3", 14 | "less-vars-to-js": "1.3.0", 15 | "react": "^16.7.0", 16 | "react-dom": "^16.7.0" 17 | }, 18 | "license": "ISC", 19 | "devDependencies": { 20 | "@zeit/next-less": "^1.0.1", 21 | "next": "^7.0.2" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pages/_document.js: -------------------------------------------------------------------------------- 1 | import Document, { Head, Main, NextScript } from 'next/document'; 2 | 3 | export default class MyDocument extends Document { 4 | render() { 5 | return ( 6 | 7 | 8 | 9 | 10 | 11 | 12 |