Comments (6)
I'd vote for keeping bankai
opinionated and favor a css-in-js approach. budo
for development and plain browserify
for building will always be a better fit if one needs full flexibility.
from bankai.
if someone wants to use an external stylesheet they can do:
const css = require('sheetify')
css('./my-local-stylesheet.css')
And it'll just work. Marking as resolved and closing
from bankai.
currently there's not, but we could totally add one - hyperstream
accepts streams as read sources so if we pass in an fs
stream of CSS into the internals this could totally work ✨ 🚀
from bankai.
From IRC just now:
@timwis: as a means of feedback, it was a little confusing that i had to register the css, then register the js, before i could output/exec either, though i understand it's because of sheetify. seems like the entire premise of having to have state in bankai is because of sheetify.
@yoshuawuyts: that would be correct yeah
ideas on how to improve?
@timwis: well, IMO the audience for something like this is wider than those who've joined the CSS-in-JS club - personally, I just started using it. so i would have expected --css to work more like budo's (pulling in something from the file system) by default. and the sheetify bit would be opt-in
@yoshuawuyts: that's a fair observation. Are you using css in js now tho?
@timwis: any consumers of the sheetify-support feature probably already associate its usage with browserify/js, so perhaps it wouldn't feel too unnatural to them to have the sheetify options as part of the js/browserify options
i am for that enviar (sms) project. i'd be hesitant to use it in a proper work project though (one i expect someone to jump into a year from now and maintain without me) just because it's not mainstream and feels quite unfamiliar at first
for the same reason i don't use a ton of ES6 or other cutting edge features
even with css-in-js though, i often use budo's --css feature to pull in https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
pretty handy for quick development. otherwise i'd have to install sheetify, install bootstrap, and include it in the js
(well, if i'm already using css-in-js, i'd have sheetify installed)
@yoshuawuyts: ah yeah; so the reason why I'm asking is because I def don't - generally try and not add features that I won't use unless someone has a clear use case for them
@timwis: yeah i'm thinking about the choo workshop i was at, introducing people to commonjs, using budo as a shortcut. having to explain how css-in-js works as well is a lot to take in - would be better to learn that on a separate occasion
but certainly worth asking other users/collaborators before making a call like that
@yoshuawuyts: yeah good point. Though on the other hand, havingcss('bootstrap')
is a nice win
"hey, how do we use CSS?" - well, you can import a package from npm like so: (...)
not sure if that would be pushing it though; but maybe it really shifts people into the next gear
reallly not sure. I think you've got a good point haha
Thoughts, other users of bankai? /cc @marionebl
from bankai.
The main usecase is really to use normalize or bootstrap global _.css_ files without having to choose a css-in-js approach at all, just load those files from a cacheable cdn and not embed them in the js bundle.
I have a project that mix rollup (for my modules) with browserify (for 3rd party modules) and sheetify don't get along well with rollup :) <-- this particular case I've workarounded with rollup-plugin-browserify-transform
from bankai.
@fczuardi you can do:
const css = require('sheetify')
css('bootstrap')
and you should be good. bankai
can then extract it to a separate file for deployment if you like. Cheers!
from bankai.
Related Issues (20)
- Bankai's forced TLS makes developing for Beaker Browser difficult HOT 3
- Question: Deployment On AWS HOT 4
- Feature request: generate csp headers for inlined scripts and style
- Using a proxy in front of Bankai fails due to too many 301 redirects
- Production build served from a subfolder HOT 1
- Server Side Rendering Skipped due to error: window is not defined HOT 4
- bundle.js & bundle.css are in hashed folders
- bankai.documents doesn't actually take an options parameter HOT 1
- 🔦 Static exports? HOT 1
- Seamless HTTPS without certificate warnings: integrate nodecert/https-server HOT 3
- Test #163 failing (on Ubuntu 18.10, Node v10.14.2) HOT 3
- 🙋Use Custom HTML Body for Server Side Rendering for non-Choo apps
- problem bundling hypercore: 'require is not defined' HOT 4
- Babel 7 support HOT 2
- Error: choo.mount: could not query selector HOT 1
- 🐛 `.documents`: Documented API missing HOT 1
- experimental prefetch help
- SSL key too small, project doesn't start HOT 6
- nanohtml transform is not applied to code transpiled from Typescript with esModuleInterop
- import scss files
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 bankai.