Giter Site home page Giter Site logo

livestyle's People

Contributors

sergeche avatar

Watchers

 avatar  avatar  avatar  avatar

livestyle's Issues

Recover from errors

While editing, sometimes document becomes invalid (for example, Invalid CSS structure error). When this happens, it’s impossible to use live update because invalid document is cached and cannot be diff’ed

Include imports

In many cases, LESS resolver might be useless since properties might contain variable that don’t exist in current stylesheet. Need to find a way to include imports into a scope

Optimize nesting resolver

For deeply nested sections resolving is performed multiple times, e.g. intermediate selectors resolved multiple times but it’s not required.

Resolve mixins

When accessing properties() method of tree, a list of mixin properties of current rule must be returned too, but marked as mixin and excluded from patching

Do not unquote string in expressions

When expression is evaluated, explicit strings are unquoted automatically:

.example{
  @s: "/";
  background-image: "@{s}a.png";
}

is transformed into

.example{
  background-image: /a.png;
}

Handle updates on editing variables

Variables are excluded from resolved tree thus can’t trigger updates. Need to compare plain LESS tree as diff, then resolve diff to plain selectors

Implement `default()`

Available only inside guard conditions and returns true only if no other mixin matches, false otherwise.

.mixin(1)                   {x: 11}
.mixin(2)                   {y: 22}
.mixin(@x) when (default()) {z: @x}

div {
  .mixin(3);
}

div.special {
  .mixin(1);
}

Mixin locking

The following code:

.lock-mixin(@a) {
 .inner-locked-mixin(@x: @a) when (@a = 1) {
    a: @a;
    x: @x;
  }
}
.call-lock-mixin {
  .lock-mixin(1);
  .call-inner-lock-mixin {
    .inner-locked-mixin();
  }
}

...should generate

.call-lock-mixin .call-inner-lock-mixin {
  a: 1;
  x: 1;
}

Resolve selectors

Selectors with variable references must be resolved to plain CSS selectors

CSSOM patching may not work

Patching via CSSOM may not work in some cases (local files, CSS from different domain). Patcher would detect such cases and lower debounce time for actual source patching in DevTools

Concat array with space

In LESS (at least), arrays in expression must be concatenated with space, not comma:

.mixin-arguments (@width: 0px, ...) {
    border: @arguments;
    width: @width;
}

.arguments {
    .mixin-arguments(1px, solid, black);
}

...should produce

.arguments {
  border: 1px solid #000000;
  width: 1px;
}

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.