Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
onsenui and git
-
Hi to all.
i’m trying to use onsenui with it’s build tools using theme.css in a cordove application.i’m able to build and use the built css in the application, but as default, the whole node_modules is ignored by git and the theme source code is inside the node_modules.
Any idea ? I don’t need to put the compiled css under git (it’s built every time), but i have to put the the theme source under git.
I’ve tried to install the onesenui module in a custom folder without using the node_modules, without success (every time, a node_modules dir is created)
-
Sorry, I’m not sure I understand what you’re doing. Are you making custom modifications to
theme.css
or something?It is correct that
node_modules
should be ignored by git. You should always be able to recreatenode_modules
from yourpackage.json
by runningnpm install
, so there is no need for git to tracknode_modules
. If you are editing files innode_modules
, there is probably a better way to do it.
-
I would like to customize the theme.css file but it’s located inside node_modules and as you correctly wrote , touching files inside that directory is not good
So, how to create a custom theme in a different directory?
-
Have you tried Theme Roller? https://onsen.io/theme-roller/?customize
-
@emccorson yes, but i dont want a pre-built file
-
If you want to customise some of the Onsen CSS rules, use Theme Roller to change what you want then download the file and add it to your source directory.
If you don’t want to do that, you should make your own CSS file with your own rules and make it take precedence over the Onsen rules. You can make your own CSS classes or just add rules for the existing Onsen classes. As long as you make sure your custom rules take precedence.
Basically, you don’t want to be editing theme.css directly
-
@emccorson said in onsenui and git:
If you don’t want to do that, you should make your own CSS file with your own rules and make it take precedence over the Onsen rules. You can make your own CSS classes or just add rules for the existing Onsen classes. As long as you make sure your custom rules take precedence.
Basically, you don’t want to be editing theme.css directly
How can i create a brand new theme and build it autonatically the css like with the stock one?
-
Create a new file that contains your CSS rules and link it in the head of your index.html file. The same way as the Onsen UI CSS files are linked. (I’m assuming you are not using a bundler or anything.)
That way you can add all your CSS rules to the file manually. I still think it would be easier to use Theme Roller to create your rules though.
-
@emccorson said in onsenui and git:
Create a new file that contains your CSS rules and link it in the head of your index.html file. The same way as the Onsen UI CSS files are linked. (I’m assuming you are not using a bundler or anything.)
That way you can add all your CSS rules to the file manually. I still think it would be easier to use Theme Roller to create your rules though.
This doens’t allow me to use cssnext syntax as stock onsen does.
-
@gandalf cssnext compiles to CSS right? So as part of your build process, you need to generate a CSS file from your custom rules written in cssnext and link it.