From 08c48204453db648afdfaa468fe92552af5befca Mon Sep 17 00:00:00 2001 From: Davi Costa Date: Thu, 31 Oct 2024 11:38:46 -0300 Subject: [PATCH 1/2] Add Liferay Clarity Global 2 CSS CX --- .../assets/global.css | 7 ++++ .../client-extension.yaml | 6 +++ .../liferay-clarity-global-css-2/package.json | 15 +++++++ .../static/global.9af9de16c85524bf0368.css | 11 +++++ .../static/global.js | 0 .../webpack.config.js | 41 +++++++++++++++++++ 6 files changed, 80 insertions(+) create mode 100644 client-extensions/liferay-clarity-global-css-2/assets/global.css create mode 100644 client-extensions/liferay-clarity-global-css-2/client-extension.yaml create mode 100644 client-extensions/liferay-clarity-global-css-2/package.json create mode 100644 client-extensions/liferay-clarity-global-css-2/static/global.9af9de16c85524bf0368.css create mode 100644 client-extensions/liferay-clarity-global-css-2/static/global.js create mode 100644 client-extensions/liferay-clarity-global-css-2/webpack.config.js diff --git a/client-extensions/liferay-clarity-global-css-2/assets/global.css b/client-extensions/liferay-clarity-global-css-2/assets/global.css new file mode 100644 index 0000000..4e4adf2 --- /dev/null +++ b/client-extensions/liferay-clarity-global-css-2/assets/global.css @@ -0,0 +1,7 @@ + +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); + + +body { + font-family: Times New Roman, serif; +} \ No newline at end of file diff --git a/client-extensions/liferay-clarity-global-css-2/client-extension.yaml b/client-extensions/liferay-clarity-global-css-2/client-extension.yaml new file mode 100644 index 0000000..3625c47 --- /dev/null +++ b/client-extensions/liferay-clarity-global-css-2/client-extension.yaml @@ -0,0 +1,6 @@ +assemble: + - include: static/*.css +liferay-sample-global-css: + name: Liferay Sample Global CSS 2 + type: globalCSS + url: global.*.css \ No newline at end of file diff --git a/client-extensions/liferay-clarity-global-css-2/package.json b/client-extensions/liferay-clarity-global-css-2/package.json new file mode 100644 index 0000000..c17bd45 --- /dev/null +++ b/client-extensions/liferay-clarity-global-css-2/package.json @@ -0,0 +1,15 @@ +{ + "devDependencies": { + "css-loader": "6.10.0", + "mini-css-extract-plugin": "^2.8.0", + "style-loader": "3.3.4", + "webpack": "5.90.1", + "webpack-cli": "5.1.4" + }, + "name": "@liferay/liferay-clarity-global-css-2", + "private": true, + "scripts": { + "build": "webpack" + }, + "version": "0.0.0" +} diff --git a/client-extensions/liferay-clarity-global-css-2/static/global.9af9de16c85524bf0368.css b/client-extensions/liferay-clarity-global-css-2/static/global.9af9de16c85524bf0368.css new file mode 100644 index 0000000..74f5f86 --- /dev/null +++ b/client-extensions/liferay-clarity-global-css-2/static/global.9af9de16c85524bf0368.css @@ -0,0 +1,11 @@ +@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap); + +body { + font-family: Times New Roman, serif; +} + +.btn-primary { + color: #ff0000; + content: 'Liferay Sample Global CSS'; + margin-left: 2rem; +} diff --git a/client-extensions/liferay-clarity-global-css-2/static/global.js b/client-extensions/liferay-clarity-global-css-2/static/global.js new file mode 100644 index 0000000..e69de29 diff --git a/client-extensions/liferay-clarity-global-css-2/webpack.config.js b/client-extensions/liferay-clarity-global-css-2/webpack.config.js new file mode 100644 index 0000000..24ce324 --- /dev/null +++ b/client-extensions/liferay-clarity-global-css-2/webpack.config.js @@ -0,0 +1,41 @@ +/** + * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 + */ + +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const path = require('path'); +const webpack = require('webpack'); + +const DEVELOPMENT = process.env.NODE_ENV === 'development'; + +module.exports = { + devtool: DEVELOPMENT ? 'source-map' : false, + entry: { + global: './assets/global.css', + }, + mode: DEVELOPMENT ? 'development' : 'production', + module: { + rules: [ + { + test: /\.css$/i, + use: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + ], + }, + optimization: { + minimize: !DEVELOPMENT, + }, + output: { + clean: true, + path: path.resolve('static'), + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].[contenthash].css', + }), + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + ], +}; From 4c808c8cf8c81e98139baaa45386c3bd0829ca2e Mon Sep 17 00:00:00 2001 From: Davi Costa Date: Fri, 1 Nov 2024 10:17:56 -0300 Subject: [PATCH 2/2] add required changes to cx --- .../liferay-clarity-global-css-2/client-extension.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client-extensions/liferay-clarity-global-css-2/client-extension.yaml b/client-extensions/liferay-clarity-global-css-2/client-extension.yaml index 3625c47..22d1c44 100644 --- a/client-extensions/liferay-clarity-global-css-2/client-extension.yaml +++ b/client-extensions/liferay-clarity-global-css-2/client-extension.yaml @@ -1,6 +1,6 @@ assemble: - include: static/*.css -liferay-sample-global-css: +liferay-sample-global-css-2: name: Liferay Sample Global CSS 2 type: globalCSS url: global.*.css \ No newline at end of file