Giter VIP home page Giter VIP logo

hack-css's Introduction

Hack CSS

Collection for css hack in different browsers. Provide a easy way to take css hack.

less

require less v1.7.0 or later

@import "path/to/hack-css.less"

// give hack for each selector which you need
.class {
    .only-ie6({
        hasLayout: 1;
    })

    .only-ie7({
        margin: 0;
    })
}

// give hack for all selector together
@only-ie6: {
    .class {
        hasLayout: 1;
    }

    #id {
        padding: 0;
    }
}

stylus

// use block to give hack to all, but you should require after
$only-ie6 = 
  .class 
    hasLayout 1
  #id
    padding 0

@import 'path/to/hack-css'
// use block mixin to hack each selector
@import 'path/to/hack-css'

.class
  +only-ie6()
    hasLayout 1
  +only-ie7()
    padding 0
// if you want both
@import 'path/to/hack-css'
... // your code
@import 'path/to/hack-css'

Note: Now don't support only-ie11, or-saf5-saf6, only-op, in the first way by stylus. If want to hack, please take the second way, sorry.

sass & scss

// hack each selector
.class {
    @include only-ie6 {
        hasLayout: 1;
    }
}

// hack all selector
@include only-ie6 {
    #id {
        hasLayout: 1;
    }
}
.class
  +only-ie6
    hasLayout: 1

+only-ie6
  .class 
    padding: 0

Hack list

  • only-ie6
  • only-ie7
  • only-ie8
  • or-ie6-ie7
  • or-ie6-ie7-ie8
  • or-ie8-ie9-ie10
  • or-ie9-ie10
  • only-ie11
  • or-saf2-saf3
  • or-saf5-saf6
    safari 5.1 ~ safari 6
  • only-ff
    firefox 3.5+
  • only-op
    opera 9.5+

Reference

hack-css's People

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.