Coder Social home page Coder Social logo

Problems with [] about stss HOT 12 CLOSED

ronaldtreur avatar ronaldtreur commented on August 29, 2024
Problems with []

from stss.

Comments (12)

RonaldTreur avatar RonaldTreur commented on August 29, 2024

Good find, thanks! This will be somewhat harder to solve but I'll get on it!

from stss.

jvandijk avatar jvandijk commented on August 29, 2024

@RonaldTreur I'm also running into this problem and browsing through the SASS reference to see if there is any way to overcome this.... haven't found a strategy yet though.

from stss.

Pyreweb avatar Pyreweb commented on August 29, 2024

Note : It works with a variable (Alloy.Globals.myvar) instead of the array (compile, and the apps run)

from stss.

jvandijk avatar jvandijk commented on August 29, 2024

@Pyreweb can you elaborate on that a bit more? Do you have a code example?

from stss.

RonaldTreur avatar RonaldTreur commented on August 29, 2024

I've been working on this issue during the weekend. I am pretty close to a solution and hope to finish it tonight. So stay tuned!

@Pyreweb Glad it wasn't a showstopper, but this obviously needs a real solution ;-)

from stss.

Pyreweb avatar Pyreweb commented on August 29, 2024

@jvandijk when I replace the [] colors part with a var, it works, because the parser doesn't have to...parse it.

In my Alloy.js

Alloy.Globals.DGDBallanger = [
    { color: '#B3C618', offset: 0.0 },
    { color: '#BDC47D', offset: 1.0 }
];

My STSS

#header {
    top: 0;
    height: 60dp;
    width: fill;
    backgroundGradient: {
        type: linear;
        startPoint: { 
            x: 0%;
            y: 0%;
        };
        endPoint: {
            x: 0%;
            y: 100%;
        };
        colors: Alloy.Globals.DGDBallanger;
    };
}

This doesn't really solve the issue, but at least, it works. It may be mentioned in the docs ?

from stss.

RonaldTreur avatar RonaldTreur commented on August 29, 2024

@Pyreweb While working on this, I also noticed the startPoint and endPoint in your example don't parse correctly (the x & y are removed and fused into one value). This is a separate issue that has my attention as well.

from stss.

RonaldTreur avatar RonaldTreur commented on August 29, 2024

I pushed a fix (not live on NPM yet). If this somehow breaks other things (or simply doesn't work for you), please let me know! I still need to extend my test-specs.

from stss.

jvandijk avatar jvandijk commented on August 29, 2024

@RonaldTreur nice work! Exactly the approach I tried as well, but failed to implement. I'll test later on.

from stss.

Pyreweb avatar Pyreweb commented on August 29, 2024

Looks like it's ok 👍

from stss.

jvandijk avatar jvandijk commented on August 29, 2024

Hey @RonaldTreur I've tested the implementation as well, but run into errors.

With this piece of STSS:

background-gradient: {
        type: 'linear';
        startPoint: {
            y: 0;
        }
        endPoint: {
            y: 3;
        }
        colors: [ $black, $tertiaryColor ];
    };

I get the following error:

[ERROR] STSS: An error occurred while parsing the (generated) SCSS for ****.stss (line: ***):
[ERROR]
[ERROR] -stss-array0-val0$black
[ERROR]
[ERROR] invalid top-level expression

It looks like there is some leading '-' missing, but just don't know for sure. Does this ring a bell?

from stss.

RonaldTreur avatar RonaldTreur commented on August 29, 2024

Ha... Yes.. That is definitely something I need to fix. Until then variables can't be used as array-values... I'll create a new issue for this!

from stss.

Related Issues (20)

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.