Giter VIP home page Giter VIP logo

generate_css_structure's Introduction

自动生成scss结构,简化前端开发

便于直接编写css样式

支持局部生成(推荐)

根据html自动生成scss结构,减少重复乏味的编写css结构流程,专注于更重要的部分。

多个class默认使用第一个class,其他class作为追加

无class时使用标签

欢迎各位前端开发使用

查看在线生成

示例成果

before:

<div class="root">
    <div class="header">
        <img src="#" alt="">
    </div>
    <div class="content">
        <div class="breadcrumb">xxx -> xxx -> xxx</div>
        <div class="side">
            <div class="list">
                <a href="#" class="item">xxx</a>
                <a href="#" class="item">xxx</a>
                <a href="#" class="item">xxx</a>
                <a href="#" class="item">xxx</a>
            </div>
        </div>
        <div class="main">
            <div class="form">
                <div class="form-group">
                    <input type="text">
                </div>
                <div class="form-group">
                    <button>XXX</button>
                </div>
            </div>
        </div>
        <div class="pager">
            <div class="item disabled">上一页</div>
            <div class="item active">1</div>
            <div class="item">2</div>
            <div class="item">3</div>
            <div class="item">下一页</div>
        </div>
    </div>
    <div class="footer">
        <div class="copyright">
            <span class="bold">XXX</span>
            <span>xxx</span>
        </div>
    </div>
</div>

after:

.header {
  img {
  }
}
.content {
  .breadcrumb {
  }
  .side {
    .list {
      .item {
      }
    }
  }
  .main {
    .form {
      .form-group {
        input {
        }
        button {
        }
      }
    }
  }
  .pager {
    .item {
      &.disabled {
      }
      &.active {
      }
    }
  }
}
.footer {
  .copyright {
    .bold {
    }
    span {
    }
  }
}

运行方式:

$ npm install
$ npm run start

配置文件:

配置项 说明
src 源html文件
dist 生成目标目录
filename 目标文件名(*.scss 或 *.less)
selector 根选择器(类似于jquery)

License

MIT

generate_css_structure's People

Contributors

lyuns avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.