from DEVELOP_THEME_BARCELONETA.rst in the theme directory:
cd <path to my plone instance>
cd src/myaddontheme
npm install
cd src/myaddontheme/theme
npm install
grunt watch
Some questions:
1 - how can I install the addon in an existing plone instance?
2 - compiling the less, I get:
Aborted due to warnings.
Completed in 1.001s at Sat Apr 24 2021 19:47:37 GMT+0200 (GMT+02:00) - Waiting...
>> File "less/custom.less" changed.
Running "less:dist" (less) task
>> barceloneta/less/code.plone.less: [L31:C11] Error evaluating function `round`: argument must be a number
Warning: Error compiling less/theme.local.less Use --force to continue.
make it work, I can change (in my src/mytheme) theme/barceloneta/barceloneta/less/variables.plone.less and see changes.
compiling directly with --math=always works:
lessc --math=always less/theme.local.less
/* theme.less file that will be compiled */ @font-face {
font-family: 'Roboto';
src: url('/++theme++cabtheme/barceloneta/less/roboto/roboto-light.eot');
[...]
but I don't know how to pass it to grunt watch task. The problem happen with lessc 3.X and 4.X
mkdir src
create the package (or move it) in src/ with plonecli
add
extensions =
mr.developer
in the [buildout] section of to buildout.cfg
and
auto-checkout +=
mypackage
before the parts section in buildout.cfg
and
[sources]
mypackage = fs mypackage path=src
at the bottom of buildout.cfg
This is because plonecli creates a setup.py in the root of the package and not in the mypackage namespace, then it address the source in the subdir src and [sources] get from it.
I got directions from https://training.plone.org/5/mastering-plone/eggs1.html
Note: ok for developing but how then we can package it avoiding the src dir?
Anyway, I tested it (mr.developer in src from git) in Plone 5.2 and even if scss is compiled, the site miss some style. Anyway, the toolbar works (I see no difference with the other bar). Maybe I miss some import step o setup?
windows specific down here (has to be installed here, fails in buildout) #Dependency of zope.sendmail:
pywin32 ; platform_system == 'Windows' ssl Certs on Windows, because Python is missing them otherwise:
certifi ; platform_system == 'Windows' #Dependency of collective.recipe.omelette:
ntfsutils ; platform_system == 'Windows' and python_version < '3.0'
If you want to, but you might as well do it manually.
Put the theme in /src folder (or wherever you want it)
Add src = /src/my.theme
run buildout
For 1) you can cd /src and git clone/checkout the theme. I never want the theme to update unless I do it on purpose: so I never use auto checkout. I just git pull from the my.theme folder
Yes the easy way is to use the selfcontained buildout of the created package.
That helps to keep the development of different packages clean and separate.
And to use the package in a project buildout, together with other packages, do what @espenmn said and add in to the develop part or use mr.developer to manager the checkout. Booth ways are used often.
regarding the round error, it might be that the variable is not set or found correctly.
There where some changes in some external resources from CMFPlone with are now in plone.staticresources. But not all of them ended up there, i think.
But you can always fix that by defining something your self and ignore the defaults from plone.