Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify theme css and add tools to do it #2015

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ help:
@grep -P '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

# If the first argument is one of the supported commands...
SUPPORTED_COMMANDS := npm restore-db-dev _restore_db_dev restore-db-prod _restore_db_prod build import_units import_users import_sections import_unit_sections
SUPPORTED_COMMANDS := minify-theme-css npm restore-db-dev _restore_db_dev restore-db-prod _restore_db_prod build import_units import_users import_sections import_unit_sections
SUPPORTS_MAKE_ARGS := $(findstring $(firstword $(MAKECMDGOALS)), $(SUPPORTED_COMMANDS))
ifneq "$(SUPPORTS_MAKE_ARGS)" ""
# use the rest as arguments for the command
Expand Down Expand Up @@ -72,6 +72,9 @@ analyze-code: ## Generate statistics about the bundle. Usage: make analyze-code.
npm: ## allow to run dockerized npm command eg make npm 'install koa --save'
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm $(COMMAND_ARGS)

minify-theme-css: ## Example: make minify-theme-css default/css/style -> mimify the style.css of the default theme
docker compose -f docker-compose.dev.yml run --no-deps --rm node npm run minify-css ./src/app/custom/themes/$(COMMAND_ARGS).min.css ./src/app/custom/themes/$(COMMAND_ARGS).css

## Tests =======================================================================

test-api-e2e: ## Run the API E2E tests
Expand Down
49 changes: 49 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"insertversion:makefile": "sed -i \"s#\\(lodex:\\)\\([\\.a-z0-9]\\+\\)#\\1${npm_package_version}#g\" Makefile",
"insertversion:docker": "sed -i \"s#\\(lodex:\\)\\([\\.a-z0-9]\\+\\)#\\1${npm_package_version}#g\" docker-compose*.yml",
"version": "npm run insertversion:readme && npm run insertversion:makefile && npm run insertversion:docker && git add README.md Makefile",
"postinstall": "cd ./packages/ezsLodex/ && npm install --production --install-strategy=nested --legacy-peer-deps && cd ../transformers/ && npm install --production --install-strategy=nested --legacy-peer-deps"
"postinstall": "cd ./packages/ezsLodex/ && npm install --production --install-strategy=nested --legacy-peer-deps && cd ../transformers/ && npm install --production --install-strategy=nested --legacy-peer-deps",
"minify-css": "cleancss -o"
},
"nodemonConfig": {
"ignore": [
Expand Down Expand Up @@ -250,6 +251,7 @@
"array-series": "0.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^27.0.6",
"clean-css-cli": "5.6.3",
"compression-webpack-plugin": "10.0.0",
"copy-webpack-plugin": "11.0.0",
"cypress": "13.6.4",
Expand Down
1 change: 1 addition & 0 deletions src/app/custom/themes/default/css/styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/custom/themes/default/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="theme-color" content="#ffc40d"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Quicksand:400,500"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/default/css/styles.css"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/default/css/styles.min.css"/>
<style><%= theme.cssVariable %></style>
</head>
<body>
Expand Down
3 changes: 3 additions & 0 deletions src/app/custom/themes/inist/css/inist-styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/custom/themes/inist/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="theme-color" content="#ffc40d">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/inist/styles.css"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/inist/css/inist-styles.css"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/inist/styles.min.css"/>
<link rel="stylesheet" href="<%= theme.base.href %>/themes/inist/css/inist-styles.min.css"/>
<style><%= theme.cssVariable %></style>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions src/app/custom/themes/inist/styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading