-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osrd-project: create tailwind preset at root
osrd-project: create base rollup.config generator osrd-project: add base postcss.config
- Loading branch information
Showing
8 changed files
with
166 additions
and
147 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = function generateBasePostcssConfig( | ||
tailwindConfigRelativePath = './tailwind.config.js' | ||
) { | ||
return { | ||
plugins: { | ||
'postcss-import': {}, | ||
'postcss-assets': {}, | ||
'tailwindcss/nesting': {}, | ||
tailwindcss: { config: tailwindConfigRelativePath }, | ||
autoprefixer: {}, | ||
'postcss-preset-env': { | ||
features: { 'nesting-rules': false }, | ||
}, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import eslint from '@rollup/plugin-eslint'; | ||
import terser from '@rollup/plugin-terser'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import livereload from 'rollup-plugin-livereload'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import process from 'process'; | ||
|
||
const formats = ['esm']; | ||
const isDev = process.env.NODE_ENV === 'development'; | ||
|
||
/** @type {import("rollup").RollupOptions} */ | ||
const generateRollupBaseConfig = (projectName, external) => ({ | ||
input: 'src/index.ts', | ||
output: formats.map((format) => ({ | ||
file: `dist/index.${format}.js`, | ||
format, | ||
name: projectName, | ||
sourcemap: true, | ||
})), | ||
plugins: [ | ||
eslint(), | ||
typescript(), | ||
postcss({ | ||
extract: 'theme.css', | ||
sourceMap: true, | ||
plugins: [], | ||
}), | ||
terser(), | ||
isDev && | ||
livereload({ | ||
watch: 'dist', | ||
}), | ||
], | ||
external, | ||
}); | ||
|
||
export default generateRollupBaseConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
export default { | ||
theme: { | ||
extend: { | ||
colors: { | ||
transparent: 'transparent', | ||
black: { | ||
1: '#00000003', | ||
2: '#00000005', | ||
25: '#00000040', | ||
75: '#000000BF', | ||
50: '#94918E', | ||
100: '#000000', | ||
}, | ||
white: { | ||
50: '#FFFFFF80', | ||
75: '#FFFFFFBF', | ||
100: '#FFFFFF', | ||
}, | ||
ambientA: { | ||
5: '#F6F8F9', | ||
10: '#EFF3F5', | ||
15: '#E9EFF2', | ||
}, | ||
ambientB: { | ||
5: '#FAF9F5', | ||
10: '#F7F6EE', | ||
15: '#F2F0E4', | ||
}, | ||
ambientC: { | ||
5: '#F6F9F6', | ||
10: '#F0F4F1', | ||
15: '#EAF0EB', | ||
}, | ||
ambientD: { | ||
5: '#F8F7FD', | ||
10: '#F4F3FC', | ||
15: '#EFEDF7', | ||
}, | ||
grey: { | ||
5: '#F5F5F5', | ||
10: '#EBEBEA', | ||
20: '#D3D1CF', | ||
30: '#B6B2AF', | ||
40: '#94918E', | ||
50: '#797671', | ||
60: '#5C5955', | ||
70: '#494641', | ||
80: '#312E2B', | ||
90: '#1F1B17', | ||
}, | ||
primary: { | ||
5: '#E3EDFC', | ||
10: '#C4DAF5', | ||
20: '#98C0F5', | ||
30: '#72A8F7', | ||
40: '#3C8AFF', | ||
50: '#256AFA', | ||
60: '#1844EF', | ||
70: '#201EDE', | ||
80: '#1F0F96', | ||
90: '#180F47', | ||
}, | ||
info: { | ||
5: '#E6F7FF', | ||
30: '#70C1E5', | ||
60: '#216482', | ||
80: '#053348', | ||
}, | ||
success: { | ||
5: '#E6F7EE', | ||
30: '#3CCA80', | ||
60: '#0B723C', | ||
80: '#003F1E', | ||
}, | ||
warning: { | ||
5: '#FDF5E1', | ||
30: '#EAA72B', | ||
60: '#7D521E', | ||
80: '#432807', | ||
}, | ||
error: { | ||
5: '#FFEEED', | ||
30: '#FF6868', | ||
60: '#D91C1C', | ||
80: '#6B0000', | ||
}, | ||
highlight: { | ||
30: '#FFF700', | ||
50: '#E8D900', | ||
}, | ||
}, | ||
}, | ||
fontFamily: { | ||
sans: ['IBM Plex sans', 'sans-serif'], | ||
serif: ['IBM Plex serif', 'serif'], | ||
mono: ['IBM Plex mono', 'monospace'], | ||
}, | ||
}, | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
module.exports = { | ||
plugins: { | ||
'postcss-import': {}, | ||
'postcss-assets': {}, | ||
'tailwindcss/nesting': {}, | ||
tailwindcss: { config: './tailwind.config.js' }, | ||
autoprefixer: {}, | ||
'postcss-preset-env': { | ||
features: { 'nesting-rules': false }, | ||
}, | ||
}, | ||
}; | ||
const generateBasePostcssConfig = require('../postcss-base.config.cjs'); | ||
|
||
module.exports = generateBasePostcssConfig(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,2 @@ | ||
import eslint from '@rollup/plugin-eslint'; | ||
import terser from '@rollup/plugin-terser'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import livereload from 'rollup-plugin-livereload'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import process from 'process'; | ||
|
||
const formats = ['esm']; | ||
const isDev = process.env.NODE_ENV === 'development'; | ||
|
||
/** @type {import("rollup").RollupOptions} */ | ||
export default { | ||
input: 'src/index.ts', | ||
output: formats.map((format) => ({ | ||
file: `dist/index.${format}.js`, | ||
format, | ||
name: 'osrdcore', | ||
sourcemap: true, | ||
})), | ||
plugins: [ | ||
eslint(), | ||
typescript(), | ||
postcss({ | ||
extract: 'theme.css', | ||
sourceMap: true, | ||
plugins: [], | ||
}), | ||
terser(), | ||
isDev && | ||
livereload({ | ||
watch: 'dist', | ||
}), | ||
], | ||
external: ['react'], | ||
}; | ||
import generateBaseRollupConfig from '../rollup-base.config.js'; | ||
export default generateBaseRollupConfig('osrdcore', ['react']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,6 @@ | ||
import osrdUiPreset from '../tailwind-preset.js'; | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
export default { | ||
presets: [osrdUiPreset], | ||
content: ['./src/**/*.{js,jsx,ts,tsx}'], | ||
|
||
theme: { | ||
extend: { | ||
colors: { | ||
transparent: 'transparent', | ||
black: { | ||
1: '#00000003', | ||
2: '#00000005', | ||
25: '#00000040', | ||
75: '#000000BF', | ||
50: '#94918E', | ||
100: '#000000', | ||
}, | ||
white: { | ||
50: '#FFFFFF80', | ||
75: '#FFFFFFBF', | ||
100: '#FFFFFF', | ||
}, | ||
ambientA: { | ||
5: '#F6F8F9', | ||
10: '#EFF3F5', | ||
15: '#E9EFF2', | ||
}, | ||
ambientB: { | ||
5: '#FAF9F5', | ||
10: '#F7F6EE', | ||
15: '#F2F0E4', | ||
}, | ||
ambientC: { | ||
5: '#F6F9F6', | ||
10: '#F0F4F1', | ||
15: '#EAF0EB', | ||
}, | ||
ambientD: { | ||
5: '#F8F7FD', | ||
10: '#F4F3FC', | ||
15: '#EFEDF7', | ||
}, | ||
grey: { | ||
5: '#F5F5F5', | ||
10: '#EBEBEA', | ||
20: '#D3D1CF', | ||
30: '#B6B2AF', | ||
40: '#94918E', | ||
50: '#797671', | ||
60: '#5C5955', | ||
70: '#494641', | ||
80: '#312E2B', | ||
90: '#1F1B17', | ||
}, | ||
primary: { | ||
5: '#E3EDFC', | ||
10: '#C4DAF5', | ||
20: '#98C0F5', | ||
30: '#72A8F7', | ||
40: '#3C8AFF', | ||
50: '#256AFA', | ||
60: '#1844EF', | ||
70: '#201EDE', | ||
80: '#1F0F96', | ||
90: '#180F47', | ||
}, | ||
info: { | ||
5: '#E6F7FF', | ||
30: '#70C1E5', | ||
60: '#216482', | ||
80: '#053348', | ||
}, | ||
success: { | ||
5: '#E6F7EE', | ||
30: '#3CCA80', | ||
60: '#0B723C', | ||
80: '#003F1E', | ||
}, | ||
warning: { | ||
5: '#FDF5E1', | ||
30: '#EAA72B', | ||
60: '#7D521E', | ||
80: '#432807', | ||
}, | ||
error: { | ||
5: '#FFEEED', | ||
30: '#FF6868', | ||
60: '#D91C1C', | ||
80: '#6B0000', | ||
}, | ||
highlight: { | ||
30: '#FFF700', | ||
50: '#E8D900', | ||
}, | ||
}, | ||
}, | ||
fontFamily: { | ||
sans: ['IBM Plex sans', 'sans-serif'], | ||
serif: ['IBM Plex serif', 'serif'], | ||
mono: ['IBM Plex mono', 'monospace'], | ||
}, | ||
}, | ||
plugins: [], | ||
}; |