Giter Site home page Giter Site logo

stylus.php's People

Contributors

austp avatar kylekatarnls avatar linusu 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stylus.php's Issues

Media queries are not supported

I just tried this for my project and immediately found it does not seem to understand media queries.

This input file results in an empty output string:

@media (max-width: 900px) {

    body { background-color: red; }

}

body { background-color: white; }

While a more complicated input file resulted in some truly broken output.

What are your thoughts on supporting media queries? These are essential for the mobile friendly CSS we need to produce. I will have to fall back on invoking node.js stylus as an external process for now.

Parse and return a string

Looking at this package for something I'm working on but it would be even better if you could simply parse a string and have it returned to you in the compiled CSS instead of having it write straight to a file.

Nested classes do not work properly

Thanks for the script! I believe I found a bug:

Test file:

<?php
    use Stylus\Stylus;
    require(dirname(__FILE__) .'/Stylus/Exception.php');
    require(dirname(__FILE__) .'/Stylus/Stylus.php');
    $stylus = new Stylus();
    $stylus->setReadDir('.');
    $stylus->setWriteDir('.');
    $stylus->parseFiles();
    $css = $stylus->fromFile("in.styl")->toString();
    echo $css;

in.styl file:

.topNav
    background #e9ebec
    .search-form
        float left
    .search-submit
        display none
    .socialLink
        text-indent -9999px`

Exports:

.topNav { background: #e9ebec; } .topNav.search-form { float: left; } .topNav.search-submit { display: none; } .topNav.socialLink { text-indent: -9999px; }

but it SHOULD export this (see the space between "topNav" and "search-submit"

.topNav {
  background: #e9ebec;
}
.topNav .search-form {
  float: left;
}
.topNav .search-submit {
  display: none;
}
.topNav .socialLink {
  text-indent: -9999px;
}

proof

isVariableDeclaration-method is trying to use non-existent variable $intent

PHP Notice:  Undefined offset: 1 in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 293
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 115
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 116
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 117
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 115
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 116
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 117
PHP Notice:  Undefined offset: 1 in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 293
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 115
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 116
PHP Notice:  Undefined variable: indent in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 117
PHP Warning:  Invalid argument supplied for foreach() in .../vendor/neemzy/stylus/src/Stylus/Stylus.php on line 350

Parsing Data URI

The regular expresion '~^\s*([^:\s\(]+)\s*:?\s*([^;]+);?\s*$~' in parseLine method is incorrect. It fails on DataURI syntax

background: url(data:image/svg+xml;base64,whatewer);

Correct it please.

Parsing imported CSS again

This line should not force the content of CSS file to parser. It should be only concatenated into current stuff.

@import 'style.css'

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.