Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Material icons node dependency - #127

Closed
lordelix wants to merge 2 commits into
masterfrom
material-icons-dependency
Closed

lordelix wants to merge 2 commits into
masterfrom
material-icons-dependency

Conversation

@lordelix

Copy link
Copy Markdown
Contributor

Remove link to fonts.googleapis.com in favor of material-icons node dependency

@lordelix

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 can you help move the copy process to a nice method in the Makefile? … Pleeeeeeeease 😁

@PVince81

PVince81 commented May 23, 2018 •

Copy link
Copy Markdown
Contributor

you need to think in terms of "what is the target file" and "what are the source files" and "what is the command":

+    "compile-theme": "lessc src/themes/owncloud.less core/css/uikit.owncloud.css --relative-urls",
+    "compile-icons": "mkdir core/fonts && cp node_modules/material-icons/iconfont/MaterialIcons-Regular.* core/fonts/ && sass src/themes/icons.scss core/css/material-icons.css --no-source-map"

for compile-themes:

  • target file: core/css/uikit.owncloud.css
  • source file / dependencies: src/themes/owncloud.less
  • process: `lessc $sourcefile $targetfile --relative-urls"

Makefile rule:

core/css/uikit.owncloud.css: src/themes/owncloud.less
    lessc $^ $@ --relative-urls

See https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html

for compile-icons part 1:

  • target file: core/fonts/*
  • source files: node_modules/material-icons/iconfont/MaterialIcons-Regular.*
  • process: copy the source files over

Makefile rule:

core/fonts/: node_modules/material-icons/iconfont/MaterialIcons-Regular.*
    mkdir -p $@ && cp $^ $@

Where $@ is the target "core/fonts" and $^ is the stuff from node_modules

for compile-icons part 2:

  • target file: core/css/material-icons.css
  • source files: src/themes/icons.scss
  • process: run sass

Makefile rule:

core/css/material-icons.css: src/themes/icons.scss
    sass $^ $@  --no-source-map

Then you need to make sure all these run when running regular make, so add more alias rules:

compile-theme: core/css/uikit.owncloud.css
compile-icons: core/fonts/ core/css/material-icons.css

then change the "all:" line and append "compile-theme compile-icons" so these rules run as well in the global make

@PVince81

Copy link
Copy Markdown
Contributor

next, you need to split npm install in its own rule:

core-deps:
    npm install

then change core rule to just depend on the other rules

core: core-deps compile-icons compile-theme

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@felixheidecke conflicting

@lordelix
lordelix force-pushed the material-icons-dependency branch from 8d96068 to 62c5a18 Compare June 14, 2018 17:13
@PVince81

Copy link
Copy Markdown
Contributor

Fixes #228

@DeepDiver1975
DeepDiver1975 force-pushed the material-icons-dependency branch from 62c5a18 to 0b22d6e Compare September 26, 2018 10:39

@PVince81 PVince81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comments

Comment thread Makefile Outdated
node_modules/less/bin/lessc src/themes/$*.less core/css/uikit.$*.css --relative-urls

core/css/material-icons.css: src/themes/icons.scss node_modules
node node_modules/.bin/sass src/themes/icons.scss core/css/material-icons.css --no-source-map

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is the node in front of it required ? I thought one can just use directly whatever is in .bin (it might have a shebang)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can replace "core/css/material-icons.css" with $@ which is an alias for the target rule if you like

Comment thread Makefile
mkdir core/fonts

core/fonts/MaterialIcons-Regular.%: core/fonts node_modules
cp node_modules/material-icons/iconfont/MaterialIcons-Regular.* core/fonts/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you use the placeholder % in the rule name, you need to also use it somewhere here in this command as $*.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well - I basically want all MaterialIcons-Regular.* to be copied over

what would be the best rule to write this?

still asking myself if this is the right approach - can't webpack just grab that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, I suspect webpack should be able to grab and even compile some stuff directly without needing extra Makefile rules.

Comment thread Makefile
#
.PHONY: core
core: core/js/core.bundle.js core/css/uikit.owncloud.css
core: core/js/core.bundle.js core/css/uikit.owncloud.css core/css/material-icons.css core/fonts/MaterialIcons-Regular.%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this might work only by chance

the "%" placeholder here will never have a value

I suggest just using "core/fonts" as dependency and have all the copying stuff done inside the "core/fonts" rule

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@michaelstingl

Copy link
Copy Markdown
Contributor

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@lordelix

lordelix commented Oct 1, 2018

Copy link
Copy Markdown
Contributor Author

why not use https://www.npmjs.com/package/vue-material-design-icons ?

The same reason why I don't fancy vueify right now. These would have to be compiled into each app instead of the theme.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Can't we Deal with this by some intelligent bundling?

@scramb scramb mentioned this pull request Nov 13, 2018
4 of 9 tasks
@DeepDiver1975
DeepDiver1975 deleted the material-icons-dependency branch November 29, 2018 14:39
AlexAndBear pushed a commit to AlexAndBear/web that referenced this pull request May 12, 2025
…r-16.x

chore(deps): update dependency sass-loader to v16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants