Source to robosho.es
roboshoes / grunt-shared-config Goto Github PK
View Code? Open in Web Editor NEWCreate config files for CSS preprocessors (SASS/SCSS/LESS/Stylus) and JS from one source
License: MIT License
Create config files for CSS preprocessors (SASS/SCSS/LESS/Stylus) and JS from one source
License: MIT License
Source to robosho.es
Hi
Maybe I've missed it, but for now it seems to be impossible to namespace variable.
It would be great to use options.name
or additional options value for that purpose, so in result we could get instead of
$car-blue: blue;
$car-red: red;
namespaced variables, like:
$myJSON-car-blue: blue;
$myJSON-car-red: red;
Hi
First of all, thanks for great product!
It seems that Sass maps generation has some issues due to lack of quotes.
For example, following generated Sass map will through an error:
$grunt-data: (
site: (
lang: en,
name: Kotsu,
title: Clean, opinionated foundation for new projects โ to boldly go where no man has gone before,
version: 0.5.3
)
);
Error: Invalid CSS after "...has gone before": expected ":", was ","
on line 5 of C:\Working\Kotsu\temp\styles\config.scss
from line 34 of source/styles/style.scss
getStyleSafeValue
doesn't produce the expected output for arrays when output to the value of a key in a Sass map
Consider this source data:
// with options.name = 'grids' & options.useSassMaps = true
{
"base": {
"gutter": 15,
"columns": 12,
"output": [ 2, 10, 12 ]
}
};
This currently results in the Sass output:
$grids: (
base: (
gutter: 15,
columns: 12,
output: 2,10,12
)
);
This will cause a parse error in Sass, as ,
is used both as a list
separator, and to denote the end of a map
key's value.
The expected output would wrap list/array output in parens to avoid this ambiguity:
$grids: (
base: (
gutter: 15,
columns: 12,
output: (2,10,12)
)
);
Happy to take a crack at this one if a PR would be considered, but #25 suggests you're looking refactoring getStyleSafeValue
anyway, so thought I'd open an issue first.
Sass Maps are currently produced in an almost minified manner. Since the JS formats are printed in formatted style, so should the sass maps.
When using a string as a value in the src
JSON file,
{ "key": "value" }
the string "value"
will be output as null
in the generated javascript file.
define( function() { return { "key": null } });
Can the script be updated to correctly translate strings to the javascript output?
I think it would be great to be able to specify wildcards in source/destination:
src: "config/*.yml",
dest: [
"styles/config/*.sass",
"scripts/config/*.json"
]
The expected behaviour would be that for each yml
file, a sass
and json
file (with the same name) would be created as well.
What do you think?
You can remove a dep, mout
, if you wanted as your usage is covered by grunt.util._
and grunt.util._.str
. If you're interested I can do a PR.
theo is very similar to shared config. But they use templates for the different outputs. This could be great feature for shared config as well. And would be easy to do with HBS files:
I could use output to angular constant. I was using grunt-ng-constant against the same json files, but I also need your unit stripping.
I'll submit a pull request, at least until GH-18 is resolved.
Great module btw :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.