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

Add Clarity Global CSS 2 Client Extension - Font Changes #3

Open
wants to merge 2 commits into
base: exercise-5-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
assemble:
- include: static/*.css
liferay-sample-global-css:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the Client Extension name.

name: Liferay Sample Global CSS 2
davicms marked this conversation as resolved.
Show resolved Hide resolved
type: globalCSS
url: global.*.css
15 changes: 15 additions & 0 deletions client-extensions/liferay-clarity-global-css-2/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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;
}
Empty file.
41 changes: 41 additions & 0 deletions client-extensions/liferay-clarity-global-css-2/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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,
}),
],
};