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..22d1c44 --- /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-2: + 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, + }), + ], +};