{"action":"created","issue":{"url":"https://api.github.com/repos/fouber/blog/issues/8","repository_url":"https://api.github.com/repos/fouber/blog","labels_url":"https://api.github.com/repos/fouber/blog/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/fouber/blog/issues/8/comments","events_url":"https://api.github.com/repos/fouber/blog/issues/8/events","html_url":"https://github.com/fouber/blog/issues/8","id":91015582,"number":8,"title":"欢迎一起探讨各自在前端开发中遇到的工程问题","user":{"login":"fouber","id":536297,"avatar_url":"https://avatars.githubusercontent.com/u/536297?v=3","gravatar_id":"","url":"https://api.github.com/users/fouber","html_url":"https://github.com/fouber","followers_url":"https://api.github.com/users/fouber/followers","following_url":"https://api.github.com/users/fouber/following{/other_user}","gists_url":"https://api.github.com/users/fouber/gists{/gist_id}","starred_url":"https://api.github.com/users/fouber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fouber/subscriptions","organizations_url":"https://api.github.com/users/fouber/orgs","repos_url":"https://api.github.com/users/fouber/repos","events_url":"https://api.github.com/users/fouber/events{/privacy}","received_events_url":"https://api.github.com/users/fouber/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fouber/blog/labels/%E6%9D%82%E8%B0%88","name":"杂谈","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":80,"created_at":"2015-06-25T16:41:07Z","updated_at":"2016-03-21T01:33:51Z","closed_at":null,"body":"恩，这个repos虽然命名是blog，一开始也定义为我的个人博客，但感觉光我一个人码字也挺空虚寂寞冷的，所以希望有在前端工程方面遇到问题，或者有所感悟，或者有所实践的同学，可以尽情在issues里开启话题来与大家分享交流，有个比较集中的地方讨论有关前端方面的工程问题也挺好的不是~~"},"comment":{"url":"https://api.github.com/repos/fouber/blog/issues/comments/199080065","html_url":"https://github.com/fouber/blog/issues/8#issuecomment-199080065","issue_url":"https://api.github.com/repos/fouber/blog/issues/8","id":199080065,"user":{"login":"zhoukekestar","id":7157346,"avatar_url":"https://avatars.githubusercontent.com/u/7157346?v=3","gravatar_id":"","url":"https://api.github.com/users/zhoukekestar","html_url":"https://github.com/zhoukekestar","followers_url":"https://api.github.com/users/zhoukekestar/followers","following_url":"https://api.github.com/users/zhoukekestar/following{/other_user}","gists_url":"https://api.github.com/users/zhoukekestar/gists{/gist_id}","starred_url":"https://api.github.com/users/zhoukekestar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhoukekestar/subscriptions","organizations_url":"https://api.github.com/users/zhoukekestar/orgs","repos_url":"https://api.github.com/users/zhoukekestar/repos","events_url":"https://api.github.com/users/zhoukekestar/events{/privacy}","received_events_url":"https://api.github.com/users/zhoukekestar/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T01:33:51Z","updated_at":"2016-03-21T01:33:51Z","body":"@feizhen js、css和html都并在一个html里面，所以，一个页面需要什么哪些组件，只要合并请求所需要的组件就行了，组件内部就包含了css和js，所以我说html是比js更好的**粘合剂**\r\n```html\r\na.html\r\n<div data-register='a'>\r\n<style>...</style>\r\n<div>...</div>\r\n<script>...</script>\r\n</div>\r\n```\r\n```html\r\nb.html\r\n<div data-register='a'>\r\n<style>...</style>\r\n<div>...</div>\r\n<script>...</script>\r\n</div>\r\n```\r\n```html\r\ndemo.html\r\n<link rel=\"import-webcom\" href=\"./a.html,b.html\">\r\n<div>这里a和b组件的css，js和html都有了</div>\r\n<div data-is='a'>a组件</div>\r\n<div data-is='b'>b组件</div>\r\n```\r\n@sssession 你的问题非常好，确实是这样的，我在项目中的实践时也遇到了，多个项目公用一个组件，但有些用了bootstrap，有些没用，一种方式是用px，另外一种在组件内部定义一个字体大小，然后采用em，如果还解决不了，那就采用js，动态去设置咯，毕竟js还是蛮强大的。最后，也是比较推荐的一种方式，还是在所有项目中约定好html的font-size，这个由前端leader定好，然后执行就行了，也就一行代码的事。"}}