Skip to content

Commit

Permalink
chore: remove obsolete embed-assets script
Browse files Browse the repository at this point in the history
  • Loading branch information
Juveniel committed Jun 20, 2024
1 parent 6e69f94 commit 77fc00b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@ To generate screenshots for a specific theme:

These steps will create new screenshots in `tests/_output`. Note that due to platform differences, all of the files will be marked as changed.

### Embedding Resources

To avoid hosting-related issues in projects that use the themes, the resources are embedded by encoding them in the output CSS. For more details, refer to [this issue](https://github.com/telerik/kendo-theme-default/issues/41#issuecomment-258472183).

To embed the latest resources:

1. Run the `npm run embed-assets` task. The task generates a file with the same name which registers a Base64-encoded version in the `$data-uris` SCSS map. For example, the `foo.woff` font file will be encoded in a `foo.scss` file which can later be imported through `@import './font/foo';`.
1. Inline the encoded file inside the CSS through `map-get( $data-uris, 'foo.woff' )`. For example:

```scss
$web-font-uri: map-get( $data-uris, 'WebComponentsIcons.woff' );

@font-face {
font-family: 'WebComponentsIcons';
src: url( $web-font-uri ) format( "woff" );
}
```

### Documenting Variables

The available variables for customizing each theme are listed in the article on customization for each theme (`docs/customization.md`) The file is generated from the SCSS source files by running the `npm run docs` command.
Expand Down
24 changes: 0 additions & 24 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ const { globSync } = require("glob");
const gulp = require("gulp");

const { sassFlatten } = require('@progress/kendo-theme-tasks/src/build/sass-flatten');
const { embedFileBase64 } = require('@progress/kendo-theme-tasks/src/embedFile');
const { getArg } = require("@progress/kendo-theme-tasks/src/utils");

// Settings
const paths = {
sass: {
all: "packages/*/scss/**/*.scss",
assets: "packages/*/scss/**/*.{png,gif,ttf,woff}",
themes: "packages/!(html)",
theme: "scss/all.scss",
swatches: "lib/swatches/*.json",
Expand Down Expand Up @@ -145,28 +143,6 @@ function swatchJsonTransformer( json ) {
}
// #endregion


// #region assets
gulp.task("assets", function() {
let files = globSync(paths.sass.assets);
let template = fs.readFileSync('lib/data-uri.template', 'utf8');

files.forEach( file => {
embedFileBase64({
file: file,
output: {
filename: '[name].scss',
path: path.dirname( file )
},
template: template
});
});

return Promise.resolve();
});
// #endregion


// #region dist
function distFlat() {
let file = paths.sass.theme;
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@

"clean": "find . -name \"node_modules\" -type d -prune | xargs rm -rf",
"clean:dist": "find ./packages -name \"dist\" -type d -prune -maxdepth 2 | xargs rm -rf",
"clean:tests": "node ./scripts/cleanup-test-results.js",

"embed-assets": "gulp assets"
"clean:tests": "node ./scripts/cleanup-test-results.js"
},
"engines": {
"node": "^20"
Expand Down

0 comments on commit 77fc00b

Please sign in to comment.