mkdir my-project && cd my-project
npm init -y
npm i -S @sap-theming/theming-base-content
/* file: src/main.css */
@import url("@sap-theming/theming-base-content/content/Base/baseLib/sap_horizon/css_variables.css");
.checkers {
background-image: url("./checkers.svg");
}
<!-- file: src/checkers.svg -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<rect x="0" y="0" width="50" height="50" fill="#000"/>
<rect x="0" y="50" width="50" height="50" fill="#fff"/>
<rect x="50" y="0" width="50" height="50" fill="#fff"/>
<rect x="50" y="50" width="50" height="50" fill="#000"/>
</svg>
npm i -D postcss-cli postcss-import postcss-url
npx postcss src/main.css -o target/main.css
// file: postcss.config.js
module.exports = {
plugins: [
require('postcss-import')(),
require('postcss-url')({filter: 'src/**/*', url: 'inline'})
]
}
/* file: target/main.css */
/**
* Copyright (c) 2012-2020 SAP SE or an SAP affiliate company. All rights reserved.
*
* Theming Engine 1.69.2
* data:{"Path": "Base.baseLib.sap_horizon.css_variables", "PathPattern": "/%frameworkId%/%libId%/%themeId%/%fileId%.css", "Extends": ["baseTheme"], "Tags": ["Fiori_3","LightColorScheme"], "FallbackThemeId": "sap_fiori_3", "Engine": {"Name": "theming-engine", "Version": "1.69.2"}, "Version": { "Build": "11.1.38.20220405122918", "Source": "11.1.38"}}
*/
.sapThemeMetaData-Base-baseLib{background-image: url('data:text/plain;utf-8,{"Path": "Base.baseLib.sap_horizon.css_variables", "PathPattern": "/%frameworkId%/%libId%/%themeId%/%fileId%.css", "Extends": ["baseTheme"], "Tags": ["Fiori_3","LightColorScheme"], "FallbackThemeId": "sap_fiori_3", "Engine": {"Name": "theming-engine", "Version": "1.69.2"}, "Version": { "Build": "11.1.38.20220405122918", "Source": "11.1.38"}}');}
:root{--sapThemeMetaData-Base-baseLib:{"Path": "Base.baseLib.sap_horizon.css_variables", "PathPattern": "/%frameworkId%/%libId%/%themeId%/%fileId%.css", "Extends": ["baseTheme"], "Tags": ["Fiori_3","LightColorScheme"], "FallbackThemeId": "sap_fiori_3", "Engine": {"Name": "theming-engine", "Version": "1.69.2"}, "Version": { "Build": "11.1.38.20220405122918", "Source": "11.1.38"}};}
:root {
--sapBrandColor: #0070f2;
--sapHighlightColor: #0070f2;
--sapBaseColor: #fff;
/* […] */
--sapFontUrl_72Mono_Bold_woff: url('../../../Base/baseLib/baseTheme/fonts/72Mono-Bold.woff');
--sapFontUrl_72Mono_Bold_full_woff2: url('../../../Base/baseLib/baseTheme/fonts/72Mono-Bold-full.woff2');
--sapFontUrl_72Mono_Bold_full_woff: url('../../../Base/baseLib/baseTheme/fonts/72Mono-Bold-full.woff');
}
.background-image--sapCompanyLogo {
background-image: var(--sapCompanyLogo);
}
.background-image--sapBackgroundImage {
background-image: var(--sapBackgroundImage);
}
.background-image--sapShell_BackgroundImage {
background-image: var(--sapShell_BackgroundImage);
}
.checkers {
background-image: url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 100 100%22%3E %3Crect x%3D%220%22 y%3D%220%22 width%3D%2250%22 height%3D%2250%22 fill%3D%22black%22%2F%3E %3Crect x%3D%2250%22 y%3D%220%22 width%3D%2250%22 height%3D%2250%22 fill%3D%22white%22%2F%3E %3Crect x%3D%2250%22 y%3D%2250%22 width%3D%2250%22 height%3D%2250%22 fill%3D%22black%22%2F%3E %3Crect x%3D%220%22 y%3D%2250%22 width%3D%2250%22 height%3D%2250%22 fill%3D%22white%22%2F%3E%3C%2Fsvg%3E");
}
// file: postcss.config.js
module.exports = {
plugins: [
require('postcss-import')(),
require('postcss-url')([
{filter: 'src/**/*', url: 'inline'},
{filter: '**/content/Base/baseLib/**/*', url: ({url}) => `https://unpkg.com/@sap-theming/theming-base-content/content/Base/baseLib/${
url.replace(/^.*\/content\/Base\/baseLib\//, '')
}`}
])
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
11 | |
10 | |
10 | |
9 | |
9 | |
8 | |
8 | |
7 | |
7 |