mipengine / mip2

MIP (移动网页加速器)通过优化网页JS、控制资源加载顺序,达到加速网页的效果。
https://www.mipengine.org/
MIT License
184 stars 49 forks source link

仅允许使用类选择器编写样式 #586

Closed yenshih closed 5 years ago

yenshih commented 5 years ago

要解决什么问题

描述一下你理想中的解决方案

mip-foo {
  .title {
    // ...
  }
  .content {
    // ...
  }
}
.mip-foo-portal-element {
  // ...
}
<style mip-custom>
  <!-- 同上 -->
</style>

描述你的备选方案

补充信息

zoumiaojiang commented 5 years ago

1、如果官方组件复杂的话,应该考虑使用 templates 方式去让开发者自己填充组件的内容,参考 mip-group-selection 组件 2、DOM 嵌套结构对组件的使用者来讲是最直观的样式,也比较好在外层直接添加类名或者 id 进行样式覆盖,官方组件的样式应该尽量设计的简单,层级明了,方便覆盖 3、为了兼容历史遗留问题,mip-fixed 现在统一需要添加 still 属性,可以保证 DOM 结构的破坏