Code Monkey home page Code Monkey logo

Comments (9)

Filipvdb321 avatar Filipvdb321 commented on July 21, 2024 1

Hi @alexmick, @sabeurthabti , I like the syntax as well!
It will allow us to get all the mainContainer styles using styles.mainContainer and apply them to the child elements of the container. We can then easily do something like: <Text style={mainContainerStyles.headerText}>Header</Text>

headerText should not have its parent attributes in my opinion. But it will give us the ability to distinguish a mainContainer.headerText from a footer.headerText for example.

from react-native-css.

alexmick avatar alexmick commented on July 21, 2024 1

headerText should not have its parent attributes in my opinion. But it will give us the ability to distinguish a mainContainer.headerText from a footer.headerText for example.

OK, we should make sure it's clear though because this might be confusing for people who commonly use scss nesting who could expect some kind of inheritance...

I'll be taking on a new react-native project very soon, I might implement this in the process, unless @Filipvdb321 is interested.

from react-native-css.

Filipvdb321 avatar Filipvdb321 commented on July 21, 2024 1

Hi @alexmick , this week I am a bit busy but next week I would be happy to work on the new feature.

from react-native-css.

siemiatj avatar siemiatj commented on July 21, 2024 1

@raz21 I don't think there's a css property for shadow-color or shadow-offset. You define them in box-shadow or text-shadow. Correct me if I'm wrong. Anyway, it's not related to this ticket.

from react-native-css.

alexmick avatar alexmick commented on July 21, 2024

That's an interesting point @Filipvdb321 , personally I've only ever used it without nesting and I don't think it was ever thought through.
What would you suggest as a syntax ? styles.mainContainer.headerText ? Should it have all the attributes of the parent as well in you opinion ?

from react-native-css.

thabti avatar thabti commented on July 21, 2024

@alexmick i am a fan of styles.mainContainer.headerText

@Filipvdb321 what do you think?

from react-native-css.

raz21 avatar raz21 commented on July 21, 2024

Hi Everyone,
I am also facing the same issue after conversion:
My Style.CSS

Wrapper{  
   background-color:#fff;
    border-radius:4;
    border-width: 1;
    border-color: #e1e8ee;
    shadow-color: rgba(0,0,0,.2);
    shadow-offset: {height:0, width:0};
    shadow-opacity:1;
    shadow-radius:1;	 
    elevation:3;
	  }

Getting converted it like:

"Wrapper":{"backgroundColor":"#fff",
"borderRadius":4,
"borderWidth":1,
"borderColor":"#e1e8ee",
"shadowColor":"rgba(0,0,0,.2)",
"shadowOffset":"{height:0, width:0"},";\t     
elevation:3;    
shadow-opacity:1;    
shadow-radius:1;
\tpadding-bottom:10;
\tmargin:10 15;\t  }

Want to add shadowOffset:{height:0, width:0}
How should I add it to css so that i could get it properly in style.js

Pls help me.

Thanks,
Rajesh

from react-native-css.

thabti avatar thabti commented on July 21, 2024

Hi @raz21,

As you're aware this is an open source project, we would love your contribution on this bug. I am able to help, as much as I can.

from react-native-css.

siemiatj avatar siemiatj commented on July 21, 2024

I needed this in one of my project so I took time and built a simple solution. Let me know what you think.

from react-native-css.

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.