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

fix: postcss plugin to remove fonts from sap-theming css variables #750

Merged
merged 3 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/postcss-remove-fonts.js
@@ -0,0 +1,12 @@
const postcss = require('postcss');

module.exports = postcss.plugin('remove font variables', function (opts) {
return function (root) {
root.walkDecls(decl => {
const regex = /--sapFontUrl_([a-zA-Z-_0-9])+/g;
if(decl.prop.match(regex)){
decl.remove();
}
});
}
});
2 changes: 2 additions & 0 deletions config/postcss.config.js
Expand Up @@ -6,6 +6,7 @@ const postcssBanner = require('postcss-banner');
const postcssAddFallback = require('./postcss-add-fallback.js');
const postcssCustomProperties = require('postcss-custom-properties'); //ie11 fallbacks
const postcssImport = require('postcss-import');
const postcssRemoveFonts = require('./postcss-remove-fonts.js');
const packageVersion = require('../package.json').version;
const year = new Date().getFullYear();

Expand Down Expand Up @@ -36,6 +37,7 @@ module.exports = {
postcssCustomProperties({
preserve: true
}),
postcssRemoveFonts(), // remove fonts from @sap-theming/theming-base-content
minify,
postcssBanner({
banner: `Fundamental Library Styles v${packageVersion}
Expand Down
Binary file removed docs/css/SAP-icons.woff
Binary file not shown.
1 change: 1 addition & 0 deletions src/fundamental-styles.scss
@@ -1,5 +1,6 @@
// do not change import order
@import "./root";
@import "./variables";
@import "./settings";
@import "./icon";
@import "./layout";
Expand Down
1 change: 1 addition & 0 deletions src/variables.scss
@@ -0,0 +1 @@
@import '@sap-theming/theming-base-content/content/Base/baseLib/sap_fiori_3/css_variables.css';