Giter Site home page Giter Site logo

ismamz / postcss-utilities Goto Github PK

View Code? Open in Web Editor NEW
319.0 319.0 11.0 859 KB

PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS

Home Page: https://ismamz.github.io/postcss-utilities

License: MIT License

JavaScript 67.19% CSS 32.81%
css mixins postcss postcss-plugins

postcss-utilities's People

Contributors

dependabot[bot] avatar ismamz avatar iyashi avatar lexich avatar marcustisater avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

postcss-utilities's Issues

Syntax highlight

I realise this is not directly relevant to the plugin,
but tried to look for ways to add the '@Util' to css/scss syntax highlighting in Atom editor
but couldn't find a reference for it.

Anyone has any advice?

more customization to `hr`

How about adding height and style arguments to hr?

/* signature: hr( [color], [vertical-margin], [style], [height] ) */
/* defaults: style = solid, height = 1px

/* before */
hr {
  @util hr(#000, 20px, dashed, 10px);
}

/* after */
hr {
  height: 0;
  border: 0;
  border-top: 10px dashed #000;
  margin: 20px 0;
  display: block;
}

Add max/min to size utility

Hello, it will be better if you can add max/min size for both width and height to the size shortcut or even create new shortcuts like min-size and max-size something like what they did here in this plugin postcss-short-size.
Thanks

Bug with centerMethod option

Hi! I found a bug with centerMethod option. Problem with number of argument in center function. This problem was solved in last pull request, but last version in npm is still 7.0. Can you provide new release?

replace `center` with more general one

Sometimes it's need to center block only vertically or horizontally. Maybe it's worth to replace center with more general align( [vertical], [horizontal] ). vertical argument can be one of top, center, bottom and horizontal argument can be one of left, center, right:

/* before */
.centered {
  @util align(center, center);
}

.aligned {
  @util align(bottom, right);
}

/* after */
.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.aligned {
  position: absolute;
  bottom: 0;
  right: 0;
}

Also It may be useful to have fill values for both arguments:

/* before */
.fill-horizontally {
  @util align(center, fill);
}

/* after */
.fill-horizontally {
  position: absolute;
  top: 50%;
  left: 0;
  rigth: 0;
  transform: translateY(-50%);
}

All this behaviour can be implemented with flexbox method too

fixed sticky footer

Hi, I wanted ask, why you choose implementation with wrapper ?
I think this realization more clean - http://mystrd.at/modern-clean-css-sticky-footer/

html {
    position: relative;
    min-height: 100%;
}
body {
    margin: 0 0 100px; /* bottom = footer height */
}
footer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 100px;
    width: 100%;
}

Documentation

Reminder to go through documentation/website, proofreading as well.

@util hr - should be able to pass 0-4 parameters without any warnings

Hi - Thanks for the helpful plugin!

I believe i've discovered a bug with @util hr;

As per the documentation, 4 parameters can be passed to the hr utility. This works as expected as far as functionality.

The Issue:
I'm currently getting a warning in the build output when I pass only one param or when I pass more than 2 params.

It seems that the issue lies in the walkAtRules function in index.js

Solution: Regarding @util hr;, based on documentation, you should be able to pass 0-4 parameters with out any warnings.

Use PostCSS 7

There are no AST API changes. We just need to update dependencies.

"centerMethod" option doesn't work as intended

Hi!

I am using this plugin with webpack and postcss-loader with postcss-load-config to load config from package.json.

In package.json I've got it configured like this:

...
    "postcss": {
        "plugins": {
            "postcss-import": {},
            "postcss-url": {},
            "postcss-utilities": {
                "centerMethod": "flexbox",
                "textHideMethod": "font"
            },
            "postcss-cssnext": {},
            "postcss-browser-reporter": {},
            "postcss-reporter": {}
        }
    },
...

And it seems to ignore passed option "centerMethod" - to use flexbox centering instead.
It keeps using the default one transform.

However! Passing option "textHideMethod": "font", works without problems.

I believe there's a typo somewhere, which doesn't switch to flexbox as intended?

Depedencies:
"postcss-utilities": "^0.7.0",
"webpack": "^3.8.1",
"postcss-loader": "^2.0.8",

Background image

Hi, I often set images as backgrounds, especially when I need specific ratio, maybe mixin for that can look something like this

.thumb-image {
  @util bg-image(/assets/images/awesome-image.jpg);
}
.thumb-image {
  background-image: url(/assets/images/awesome-image.jpg);
  background-position: center;
  background-size: cover;
}

Or maybe in combination with aspect-ratio mixin

.thumb-image {
  @util aspect-ratio(16:9);
  @util bg-image(/assets/images/awesome-image.jpg);
}

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.