Comments (10)
I think one of these should do what you need:
- https://github.com/assemble/assemble-less#process
- https://github.com/assemble/assemble-less#metadata
- https://github.com/assemble/assemble-less#pass-in-data-from-json-or-yaml
from assemble-less.
Hmm, I'm afraid not. I was looking at all of these.
'Process' comes close, because it allows to use a variable that is defined in Gruntfile.js. However, I'd rather not process all the source files just to interpolate one instance of a Grunt template. Asset building is somewhat slow as it is already.
'Metadata' and 'pass in' depend on files in a specific format. This is pretty much incompatible with my setup, where the whole configuration of the framework is a product of deep merging JS(ON) from multiple files, most of which are edited by users. This config creation is done when starting the server/framework and each time a Grunt task is executed. The variable I need to inject into Less is defined during this process.
It would just be very handy to have a straightforward mechanism to inject some simple variables into the parser. The values of which are only known once Grunt is running its tasks.
from assemble-less.
I'm struggling to see exactly what you want to do, do you have a live example somewhere? it would help for me to see it live, and failing.
Also, if you care to share some of what you're working on, I might be able to help you improve even further. I'm working on other solutions that you might be able to leverage as well.
from assemble-less.
actually, let me look at 0.4.8 and see what I was doing differently too
from assemble-less.
It's a bit difficult to describe what's going on in a GH issue. I hope this gives you enough pointers.
A live example... not currently. But it would not be very helpful to observe the framework only from the client perspective.
Of course you can look at the full source of the project, no problem. Feel free to clone and run the project from the develop branch. ;) The project is here: https://github.com/MarcDiethelm/xtc
npm start
and npm test
are set up.
For one there's the now failing test when using a banner to inject a variable:
https://travis-ci.org/MarcDiethelm/xtc/jobs/11159778
This is the Grunt target 'less:external':
https://github.com/MarcDiethelm/xtc/blob/develop/Gruntfile.js#L184
(At the top of this file you see an example of how the configuration is built. This mechanism is used in many tests and the app itself.)
Here's a the test fixture (.less) that uses the variable:
https://github.com/MarcDiethelm/xtc/blob/develop/test/assets/fixtures/_base/css/elements/base1.less
(Testing with this fixture fails earlier than the above test output indicates, because the variable is not defined. I added this part to the test after the initial failures. Nonetheless I need it to pass.)
If you have questions just ask. In the meantime thanks a ton for looking into this.
from assemble-less.
I went ahead and made the changes to restore banner behavior. Includes tests.
Please ignore b8a39ed, it references a commit on a deleted branch, made before I added the tests. Github should not even show it.
from assemble-less.
Can you publish the changes on npm? ...New installs of my framework will work again and Travis will report passing builds.
from assemble-less.
no prob, thanks for the reminder!
from assemble-less.
done. however the tests are failing. looks whitespace related
from assemble-less.
nvm, I fixed it
from assemble-less.
Related Issues (20)
- Dependency not available, install fails HOT 16
- Differences to grunt-contrib-less HOT 7
- Whitespace around comments handled different from lessc HOT 2
- less "modules" HOT 14
- Version option doesn't allow absolute paths HOT 5
- Imports directives should support globbing HOT 7
- banner should be appended after the css is compressed HOT 1
- Imports reference broken HOT 21
- @media query and mixin issue HOT 3
- grunt-lib-contrib is deprecated HOT 1
- use `chalk` instead of `colors` HOT 1
- Error : Warning: Task "less" not found. Use --force to continue. HOT 5
- How to use globalVars? HOT 1
- is it possible to not parse / exclude a custom syntax? HOT 1
- Maximum call stack size exceeded...
- Pass metadata to Lo-Dash templates HOT 1
- Undefined variable event after importing variables file HOT 1
- Documentation names task as assemble-less while the plugin uses "less" HOT 1
- Default "version" option gives an error. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assemble-less.