blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.23k stars 1.25k forks source link

发现很多style css被渲染到body中了,虽然浏览器渲染正常,但严格来说是错误 #786

Open appotry opened 2 years ago

appotry commented 2 years ago

改了个background的ccs位置错误 https://github.com/blinkfox/hexo-theme-matery/pull/785

其它地方的style 也可以用类似的方法修改,例如index-cover 的包含判断是下面这样的

但是发现要完全修正这个渲染错误,要改的地方太多了,而且不雅观


<% if (is_home() && page.current === 1) { %>
    <!-- index cover -->
    <style>
        .carousel-control {
            width: 45px;
            height: 45px;
            line-height: 55px;
            border-radius: 45px;
            background: transparent;
            cursor: pointer;
            z-index: 100;
        }

    </style>
<% } else { %>
    <!-- bg-cover style     -->
<% } %>

最近看文档,发现一些css预处理语言 ,:LessSassStylus。原生 CSS 难以复用,不能使用循环,不能使用布尔判断,书写不够方便,等等。Hexo 默认使用的是 Stylus,如果可以加入这个就好了,这可是个超级大工程

a347807131 commented 1 year ago

这个问题就像公司新来的吐槽:“诶!你这代码怎么没注释,方法名乱起?就没人去改一改、整理整理吗?”