Tips for Remake

Ordering Data

It's helpful to always attach data (e.g. key:*) attributes as high as possible on the page.

In Remake, data can impact anything below it. So if a key:* attribute is attached high on the page, then it will be able to control more of the page.

For example, if you want to trigger a watch:* attribute when a key:* attribute changes, the watch:* attribute needs to be inside the element with the key:* attribute.

Another example: if you want to hide an element based on the value of a key:* attribute, it's really easy to do with the show-if attribute. But the show-if attribute needs to be inside the key:* attribute.

Don't use #if

Remake is rendered with the Handlebars.js templating library, which comes with support for {{#if}} statements.

In most web apps, you'd use these {{#if}} statements to control the visibility of elements.

In Remake, however, it's strongly recommended to render all data/elements to the page — and then simply show/hide the ones you need (Remake's visibility helper is really useful for this).

This is because Remake treats your pages as (potentially giant) blobs of data and a lot of that time that data relies on other data being there. If the element with some data is merely hidden, Remake can get it and use its values. However, if it's never rendered to the page (because an {{#if}} statement blocked it) then Remake simply won't know that data is there.

Styling

Remake transforms your page into one big piece of data.

This makes it a lot easier than normal to style your page based on which data is set and which data isn't.

For example, lets say you wanted to implement a Dark Mode theme on your page. Your HTML might look like this:

<body object key:dark-mode="true">
  <button toggle:dark-mode>Toggle Dark Mode</button>
</body>

Now, in your CSS you can style the page normally if Dark Mode is not enabled and differently if it is:

body {
  background: #fff;
  color: #222;
}

body[key\:dark-mode="true"] {
  background: #222;
  color: #fff;
}

Tip: You must escape the colon (:) in CSS selectors with a back slash (\).

View on GitHub
☰ Menu

玻璃钢生产厂家云浮玻璃钢雕塑现货河南酒店玻璃钢雕塑运城玻璃钢人物雕塑小品公司西安玻璃钢道教雕塑定制菏泽泡沫玻璃钢景观雕塑麻城玻璃钢卡通座椅雕塑上海卡通玻璃钢雕塑厂亳州定制玻璃钢雕塑熊出没商场美陈海伦玻璃钢门头雕塑齐齐哈尔人物玻璃钢雕塑厂家深圳儿童玻璃钢雕塑工厂上海卡通玻璃钢动物鹤雕塑包头园林玻璃钢雕塑制作兰州玻璃钢雕塑制作公司山南玻璃钢雕塑制作厂家上海玻璃钢雕塑有哪些湖北标牌标识玻璃钢雕塑成都玻璃钢花盆工厂花溪区玻璃钢雕塑订做玻璃钢雕塑制作国家规范鹤岗商场美陈装饰镇江玻璃钢仿铜雕塑定做价格玻璃钢雕塑一般厚度多少钱重庆个性化玻璃钢雕塑定制佛山郑成功玻璃钢人物雕塑不锈钢水景校园玻璃钢雕塑小品玻璃钢雕塑游乐设备玻璃钢豹雕塑济源玻璃钢卡通雕塑厂家地址香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化