tachyons-css / generator Goto Github PK
View Code? Open in Web Editor NEWGenerate a custom Tachyons build from a config file
Home Page: https://components.ai/tachyons-theme
License: MIT License
Generate a custom Tachyons build from a config file
Home Page: https://components.ai/tachyons-theme
License: MIT License
Is there a roadmap of things that need to be completed before the generator is deemed "ready for production?"
Link to GitHub, other pages, config, object, example html, etc.
With the generator, is there a possibility to remove the normalize.css from the bundle?
We wanted to try modern-normalize instead of the normalize.css which comes bundled with tachyons.
That would be useful when you only support the latest browsers and want a variable.css file where you declare your colors.
example:
{
"disable": [
"aspect-ratios",
"tables"
]
}
All @media in min- and max-width has missing units.
@media screen and (min-width: 128) { ... }
So excited about this tool!
Any chance it will allow us to define colors not included in Tachyons by default?
Some projects could really use a variable for brown, more shades of orange and gold, etc. and having the generator spread these colors throughout Tachyons (e.g. .b--brown
or .hover-bg-light-orange
) would be so helpful.
Did you mean for it to be?
"spacing": [0.25, 0.5, 1, 2, 4, 8, 16]
I'm not sure if this is a bug or if its intentional, but it seems the bg and border class names with the opacity values are not generated.
b--white-##
bg-white-##
b--black-##
bg-black-##
etc.
Would be great to be able to load external npm modules to get "third-party" tachyons modules or even additional libs into the same bundle.
Something like this, perhaps:
{
"typeScale": [
3, 2.25, 1.5, 1.25, 1, 0.875
],
"spacing": {
"root": 8,
"ratio": 2,
"steps": 6
},
"external": {
"npm@animate-css": "^3.5.2"
}
}
If I add to the config:
"skipModules": [
"colors"
]
it looks like it skips the item named "colors" in the manifest, but because other items in the manifest have colors: true, the colors are still generated. In the full .css file, I see them in there 3 times.
The .debug
and .debug-grid
aren't outputted, even though they are present in the original tachyons bundle.
Why was this choice taken? They are pretty useful
This is where they get excluded
Lines 35 to 40 in 3feb114
I've made a pull request to restore them, if we decide so
Could allow us to generate different CSS files that won't need to deliver all vendor prefixes if I'm using Chrome, there is no need for IE, Webkit and Firefox prefix, this help reduce files size.
Perhaps, a simple browser detection in our Javascript should deliver the CSS with vendors specific and full CSS for unknown web browser agent.
all right, so we use this
"typeScale": [
3.25, 2.5, 1.25, 1, 0.75
],
to generate this
/*
TYPE SCALE
Docs: http://tachyons.io/docs/typography/scale/
Base:
f = font-size
Modifiers:
1 = 1st step in size scale
2 = 2nd step in size scale
3 = 3rd step in size scale
4 = 4th step in size scale
5 = 5th step in size scale
*/
.f1 { font-size: 3.25rem; }
.f2 { font-size: 2.5rem; }
.f3 { font-size: 1.25rem; }
.f4 { font-size: 1rem; }
.f5 { font-size: .75rem; }
This is totally fine, it's the tachyons way. however, communicating to a larger team when to use which font size is not always easy. Adding semantic meaning to scales helps making them easier to understand and read
Semantic proposal:
"typeScale": [
{"value": 3.25, "alias": "title"},
{"value": 2.5, "alias": "sub"},
{"value": 1.25, "alias": ["copy", "error"]},
1,
0.75
],
would generate this
/*
TYPE SCALE
Docs: http://tachyons.io/docs/typography/scale/
Base:
f = font-size
Modifiers:
1 = title
2 = sub
3 = copy, error
4 = 4th step in size scale
5 = 5th step in size scale
*/
.f1, .ftitle { font-size: 3.25rem; }
.f2, .fsub { font-size: 2.5rem; }
.f3, .fcopy, .ferror { font-size: 1.25rem; }
.f4 { font-size: 1rem; }
.f5 { font-size: .75rem; }
what do you think?
There is a missing backslash \ after the "json" in the Readme.
curl -X POST \
-H "Content-Type: application/json" \
-d @config.json
https://tachyons.pub
Please close if not relevant.
I'm trying to replicate the "original" tachyons CSS library from tachyons.io website using this generator.
Reasoning: we want to migrate to the generator and customise existing scales and values, but we want the transition to happen gradually as we don't have the resources to rewrite everything in one go.
We currently have a config.json
which is very close to the css library hosted on the main website.
Unfortunately, we use one "colour" inherit
which is in the main project but cannot be added to the generator.
As soon as you add:
{
"colors": {
"inherit": "inherit"
}
}
The library fails with the following error:
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
Node#moveTo was deprecated. Use Container#append.
(node:6464) UnhandledPromiseRejectionWarning: Error: Unable to parse color from string "inherit"
at new Color (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/node_modules/color/color.js:31:15)
at Color (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/node_modules/color/color.js:7:41)
at /Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/index.js:30:21
at /Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/node_modules/lodash/index.js:3073:15
at Function.forIn (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/node_modules/lodash/index.js:3362:16)
at module.exports (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/colorable/index.js:29:9)
at Colorable (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/tachyons-generator/docs/components/Colors.js:51:5)
at module.exports (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/tachyons-generator/docs/components/Colors.js:77:17)
at module.exports (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/tachyons-generator/docs/components/Styleguide.js:21:5)
at module.exports (/Users/pole/Sites/learnk8s/learnk8s.io/node_modules/tachyons-generator/docs/index.js:9:23)
(node:6464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is there any workaround available?
currently, the logic generates breakpoints based on the following breakpoint
so it seems, that the breakpoint ns
which is available in the regular tachyons cannot be produced
I want to mirror the material design breakpoints, which include not only xs
, sm
, md
, lg
, xl
, but also gt-xs
, gt-sm
, gt-md
, gt-lg
(greater-than). They have the same semantic logic as tachyons' ns
, basically only describing the min-width
as for the json config, this could be indicated with <=
and/or >=
"customMedia": [
{ "sm": "600px" },
{ "md": "960px" },
{ "lg": "1280px" },
{ "xl": "1920px" },
{ "gt-xs": ">=600px" },
{ "gt-sm": ">=960px" },
{ "gt-md": ">=1280px" },
{ "gt-lg": ">=1920px" }
],
where >=600px
would result in screen and min-width(600px)
I admit, this does not look nice, but thats only from the top of my head
Some time ago I send this PR that solves some of the major issues with the project, but it hasn't been looked or reviewed since.
You don't have any time to work on this repo? Do you need mantainers?
What is this supposed to do? Nothing seems to happen after the re
$ curl -X POST \
→ -H "Content-Type: application/json" \
→ -d '{"typeScale": [5,4,3,2,1,0.5] }' \
→ https://tachyons.pub
<!doctype html>
<!-- https://now.sh -->
<h1>Redirecting (302)</h1>
<a href="https://zeit.co/johno/tachyons-publish-api/bvyenznlao?redirect=1">https://zeit.co/johno/tachyons-publish-api/bvyenznlao?redirect=1 </a>
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.