GithubHelp home page GithubHelp logo

peterramsing / lost Goto Github PK

View Code? Open in Web Editor NEW
4.5K 111.0 161.0 1.71 MB

LostGrid is a powerful grid system built in PostCSS that works with any preprocessor and even vanilla CSS.

Home Page: http://lostgrid.org

License: MIT License

JavaScript 58.37% Shell 0.06% TypeScript 41.57%
grid postcss javascript css

lost's Issues

add optional parameter to enable/disable initialization

It would be nice if there was a parameter to enable/disable the initalization of the columns, this would decrease a lot the size of the stylesheet, expecially if you're trying to generate a custom grid (similar to bootstrap). See the example below, where the @include column($init: true); would simply output float and margins, the for loop would only output the width.

[class*="col-"] {  // init
    @include column($init: true);
}
@for $i from 1 through 12 {
    .col-#{$i} { 
        @include column(#{$i}/12, $init: false);
    }
}
@include media-query(min-width: 380px) {
    @for $i from 1 through 12 {
        .col-xs-#{$i} { 
            @include column(#{$i}/12, $init: false);
         }
    }
}
@include media-query(min-width: 480px) {
    @for $i from 1 through 12 {
        .col-md-#{$i} { 
            @include column(#{$i}/12, $init: false);
        }
    }
}

Port to LESS

  • edit
  • cf
  • center
  • align
  • block
  • offset
  • move
  • masonry-row

Namespacing!

Great project, Cory, but I strongly, strongly suggest that you namespace your mixins (and functions, if applicable). Names such as edit, center, block, etc. are very general and there is a high likelihood that this could cause naming collisions with mixins/functions in other projects.

Perhaps something like lost-block, lost-center, etc.?

Lost with several CSS files

Hi,

I use lost in several CSS files (using Gulp). In this context, the following code is written in each file:

.container {
  max-width: 1000px;
  margin-right: auto;
  margin-left: auto;
  padding-left: 0;
  padding-right: 0;
}
.row {
  *zoom: 1;
  margin-left: -15px;
  margin-right: -15px;
}
.row:before,
.row:after {
  content: '';
  display: table;
}
.row:after {
  clear: both;
}
.container {
  max-width: 1000px;
  margin-right: auto;
  margin-left: auto;
  padding-left: 0;
  padding-right: 0;
}
.row {
  *zoom: 1;
  margin-left: -15px;
  margin-right: -15px;
}
.row:before,
.row:after {
  content: '';
  display: table;
}
.row:after {
  clear: both;
}

Would it be possible to have an option to write or not this part of the code (or another solution...)? In order to write only this code in one file.

Thanks

Lost with Gulp

Hi,

I tried to use lost with Gulp but it does not work with this syntax: .pipe(stylus({use: [rupture(), lost()]}))

I solved the problem by using the code of "rupture" (index.js). Or should I write differently?

Thank you for this excellent project!

$rtl variable is right-to-left when false

Using the SCSS version, I made a test using the sample code provided in the README:

<section>
  <figure>1</figure>
  <figure>2</figure>
  <figure>3</figure>
  <figure>4</figure>
</section>

section {
  @include cf;
}

figure {
  @include block('1/2');
}

However, it seems that right-to-left mode is the default. The list of numbers displays as: "2, 1, 4, 3" by default. When $rtl is set to true, it displays the way I would expect it to if $rtl was false: "1, 2, 3, 4". Either I've overlooked something or there is a faulty $rtl conditional in the code.

Sass 3.2

Do you still need to support Sass 3.2?

Add testing

Preferably image-diff since Sass and Stylus will always fail at matching percentage values since they have different specificity on floats.

Consider changing $cycle name

$cycle doesn't just control things looping to the next row anymore. It's sometimes part of the math involved.

Maybe something esoteric like Neat's $omega, or something descriptive like $ipr ("items per row").

Open to ideas on this, but I'd really like to move away from $cycle.

Setup Documentation

Hey Cory, first off i just want to say that I am extremely excited about this grid and can't wait to try it out. I think it will really add to the projects that I am currently working on. Now,excitement aside I cannot seem to get your grid working and would really love if you could create a step by step guide on how to setup the lost grid.

Thanks so much, Mooror

Remove support for $old

With calc polyfill this works for ie8. IE9+ w/o. I don't think there's a need for old syntax - ever.

Change syntax from block() to column(), row(), and waffle()

This would be an easy change. I'm hoping to get some community feedback though.

Basically the change would be changing code like this:

.foo
  block('1/3', column)
  @media (min-width: 800px)
    block('1/2')
  @media (min-width: 1100px)
    block('1/3', both)

...to code like this:

.foo
  row('1/3')
  @media (min-width: 800px)
    column('1/2')
  @media (min-width: 1100px)
    waffle('1/3')

Personally I think it looks better and is more readable, but I want to get community feedback. Obviously this would be a major version bump up to 5.0.0.

Horizontal Scroll on Chrome Mobile

I am getting horizontal scrolling on Chrome mobile. Here is my styl file:

@import 'lost'
html
     overflow-x hidden
section
    row()
    article
        cycle(3)
        column(1/3)

Here is my html file:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Template</title>
    <link href="css/styles.css" rel="stylesheet">
  </head>
  <body>
    <section>
      <article>
        1
      </article>
      <article>
        2
      </article>
      <article>
        3
      </article>
      <article>
        4
      </article>
      <article>
        5
      </article>
      <article>
        6
      </article>
    </section>
  </body>
</html>

Is this a bug or am I missing somthing?

Thanks

IE8 support

What are the basic requirements to make this grid system work on IE8? Would it be enough to add Respond, html5shiv, and a calc-polyfill? I know that the align() mixin won't work, but that's ok, I just wonder if the main grid can be used with the simple addition of calc-polyfill? I have used selectivizr in the past but usually doesn't work very well when you combine it with respond, expecially in a complex layout.

If anyone is interested

First of all, I love this calc based grid. Good job Cory.
Second, If anyone is interested I have built a fully responsive 12 col grid system with 4 MQ breaks using Corys' code. I could share what I have done and maybe get some help to perfect it... My initial tests have shown that it works great.

Full page width?

How to achieve full page width? (100%)
Currently pages look like this (default settings)(Notice those blue margins)
hey

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.