Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 61 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
{
"name": "communitytaught",
"version": "1.0.0",
"description": "MVC boilerplate for Node/MongoDB projects with Tailwind and Pug, with authentication via Passport.",
"main": "src/server.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node .",
"dev": "nodemon . --ignore 'src/assets/js/*.js' --ignore 'cypress/**/*.js' --ignore 'test/**/*.js'",
"css": "npx tailwindcss -i ./src/tailwind.css -o ./src/assets/css/index.css --watch",
"e2e": "cypress run --browser chrome",
"e2e:watch": "cypress open",
"e2e:video": "cypress open --config videoRecording=true",
"e2e:record": "cypress run --record --browser chrome",
"e2e:record:edge": "cypress run --record --browser edge",
"e2e:record:firefox": "cypress run --record --browser firefox",
"cy:verify": "cypress verify",
"cy:info": "cypress info",
"cy:version": "cypress version",
"cy:cache:list": "cypress cache list"
},
"repository": {
"type": "git",
"url": "git+https://github.com/labrocadabro/node-mongo-boilerplate.git"
},
"author": "Laura Abro",
"license": "MIT",
"bugs": {
"url": "https://github.com/labrocadabro/node-mongo-boilerplate/issues"
},
"homepage": "https://github.com/labrocadabro/node-mongo-boilerplate#readme",
"dependencies": {
"@octokit/auth-oauth-user": "^2.0.3",
"@octokit/core": "^4.0.5",
"connect-mongodb-session": "^3.1.1",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"express": "^4.18.1",
"express-session": "^1.17.3",
"mongoose": "^8.0.3",
"morgan": "^1.10.0",
"nodemailer": "^6.7.8",
"passport": "^0.7.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^8.0.0",
"pug": "^3.0.2",
"validator": "^13.7.0"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
"cypress": "^13.6.2",
"jest": "^29.4.1",
"nodemon": "^3.0.2",
"supertest": "^6.3.3",
"tailwindcss": "^3.1.8",
"vitest": "^3.0.7"
}
}
"name": "communitytaught",
"version": "1.0.0",
"description": "MVC boilerplate for Node/MongoDB projects with Tailwind and Pug, with authentication via Passport.",
"main": "src/server.js",
"type": "module",
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"start": "node .",
"dev": "nodemon . --ignore 'src/assets/js/*.js' --ignore 'cypress/**/*.js' --ignore 'test/**/*.js'",
"css": "npx tailwindcss -i ./src/tailwind.css -o ./src/assets/css/index.css --watch",
"e2e": "cypress run --browser chrome",
"e2e:watch": "cypress open",
"e2e:video": "cypress open --config videoRecording=true",
"e2e:record": "cypress run --record --browser chrome",
"e2e:record:edge": "cypress run --record --browser edge",
"e2e:record:firefox": "cypress run --record --browser firefox",
"cy:verify": "cypress verify",
"cy:info": "cypress info",
"cy:version": "cypress version",
"cy:cache:list": "cypress cache list"
},
"repository": {
"type": "git",
"url": "git+https://github.com/labrocadabro/node-mongo-boilerplate.git"
},
"author": "Laura Abro",
"license": "MIT",
"bugs": {
"url": "https://github.com/labrocadabro/node-mongo-boilerplate/issues"
},
"homepage": "https://github.com/labrocadabro/node-mongo-boilerplate#readme",
"dependencies": {
"@octokit/auth-oauth-user": "^2.0.3",
"@octokit/core": "^4.0.5",
"connect-mongodb-session": "^3.1.1",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"express": "^4.18.1",
"express-session": "^1.17.3",
"mongoose": "^8.0.3",
"morgan": "^1.10.0",
"nodemailer": "^6.7.8",
"passport": "^0.7.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^8.0.0",
"pug": "^3.0.2",
"validator": "^13.7.0"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
"cypress": "^13.6.2",
"jest": "^29.4.1",
"nodemon": "^3.0.2",
"supertest": "^6.3.3",
"tailwindcss": "^3.1.8",
"vitest": "^3.0.7"
}
}
133 changes: 88 additions & 45 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,47 +1,90 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/views/**/*.pug", "./src/assets/js/*.js"],
theme: {
screens: {
xs: "640px",
sm: "780px",
md: "926px",
lg: "1024px",
xl: "1280px",
"2xl": "1536px",
},
extend: {
fontFamily: {
logo: ["Orienta", "serif"],
main: ["Poppins", "sans-serif"],
awesome: ['"Font Awesome 6 Free"'],
},
colors: {
twilight: {
50: "#f1f8fa",
100: "#E8F3F7",
200: "#bfe0ee",
300: "#9ed0e5",
400: "#7ec0dd",
500: "#5eb1d4",
600: "#3ea1cc",
700: "#2e86ab",
800: "#226581",
900: "#153f51",
},
},
textUnderlineOffset: {
6: "6px",
},
textDecorationThickness: {
3: "3px",
},
maxWidth: {
"1/3": "33%",
80: "20rem",
},
},
},
plugins: [require("@tailwindcss/forms")],
safelist: ["flash-success", "flash-error", "flash-info"],
};
content: ["./src/views/**/*.pug", "./src/assets/js/*.js"],
darkMode: 'class', // Use class-based dark mode for maximum compatibility
theme: {
screens: {
xs: "640px",
sm: "780px",
md: "926px",
lg: "1024px",
xl: "1280px",
"2xl": "1536px",
},
extend: {
fontFamily: {
logo: ["Orienta", "serif"],
main: ["Poppins", "sans-serif"],
awesome: ['"Font Awesome 6 Free"'],
},
colors: {
// Existing Twilight Color Palette
twilight: {
50: "#f1f8fa",
100: "#E8F3F7",
200: "#bfe0ee",
300: "#9ed0e5",
400: "#7ec0dd",
500: "#5eb1d4",
600: "#3ea1cc",
700: "#2e86ab",
800: "#226581",
900: "#153f51",
},

// Dark Mode Color Palette - Professional & Accessible
dark: {
// Background colors
background: {
DEFAULT: '#121212', // Deep, soft black
secondary: '#1E1E1E', // Slightly lighter for secondary areas
tertiary: '#2C2C2C', // Lighter for tertiary elements
},

// Text colors
text: {
primary: '#E0E0E0', // Light gray for primary text
secondary: '#B0B0B0', // Muted gray for secondary text
muted: '#808080', // Very muted for less important text
},

// Accent colors
accent: {
DEFAULT: '#3EA1CC', // Using existing twilight accent
hover: '#2E86AB', // Existing twilight hover color
light: '#5EB1D4', // Existing lighter twilight variant
},

// Interactive colors
interactive: {
DEFAULT: '#4CAF50', // Green for positive actions
hover: '#45A049', // Slightly darker green
destructive: '#F44336', // Red for destructive actions
},

// Border colors
border: {
DEFAULT: '#404040', // Dark gray border
subtle: '#2C2C2C', // More subtle border
},
},
},

// Enhance text decoration and underline for dark mode
textUnderlineOffset: {
6: "6px",
},
textDecorationThickness: {
3: "3px",
},

// Maximum width extensions
maxWidth: {
"1/3": "33%",
80: "20rem",
},
},
},
plugins: [require("@tailwindcss/forms")],
safelist: ["flash-success", "flash-error", "flash-info", "dark"],
};
33 changes: 33 additions & 0 deletions tests/tailwind-config.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { describe, it, expect } from 'vitest';

describe('Tailwind Dark Mode Configuration', () => {
const tailwindConfig = require('../tailwind.config.cjs');

it('should have dark mode enabled', () => {
expect(tailwindConfig.darkMode).toBe('class');
});

it('should have dark mode color palette', () => {
const darkColors = tailwindConfig.theme.extend.colors.dark;

// Check basic structure
expect(darkColors).toBeDefined();
expect(darkColors.background).toBeDefined();
expect(darkColors.text).toBeDefined();
expect(darkColors.accent).toBeDefined();
expect(darkColors.interactive).toBeDefined();
expect(darkColors.border).toBeDefined();
});

it('should maintain twilight color palette', () => {
const twilightColors = tailwindConfig.theme.extend.colors.twilight;

expect(twilightColors).toBeDefined();
expect(twilightColors[50]).toBe('#f1f8fa');
expect(twilightColors[900]).toBe('#153f51');
});

it('should include safelist with dark class', () => {
expect(tailwindConfig.safelist).toContain('dark');
});
});
Loading