GithubHelp home page GithubHelp logo

Comments (8)

geelen avatar geelen commented on May 4, 2024

What might that look like? styled(x)y:z;`` for some x y and z

from styled-components.

mxstbr avatar mxstbr commented on May 4, 2024

Same API, except with ReactNative primitives?

styled.View`
border: 1px solid red;
`;

(see here for more info on RN styling)

from styled-components.

geelen avatar geelen commented on May 4, 2024

From discussion, the idea is to provide the same API at two endpoints

import styled, { css, ... } from 'styled-components'
import styled, { css, ... } from 'styled-components/native'

The difference is that the DOM one supports nesting, media queries etc, and generates className. The native one doesn't and generates a styles object. We could even not call it the 'native' endpoint but 'inline' instead, since that's all it's doing...

from styled-components.

geelen avatar geelen commented on May 4, 2024

Just thinking about this, if we are going to supply styled.View (as apposed to only allowing styled(View) that means our project is going to depend on react-native just so we can match up our imported symbols. Is there any way around that, or is that not too much of a problem?

from styled-components.

mxstbr avatar mxstbr commented on May 4, 2024

Is there any way around that, or is that not too much of a problem?

Why not make it a peerDep?

Also, I've been thinking about this – we could not only have /native, but also /choo, /glimmer, even /dom. What if we returned a representation of a generic component from styled calls, and then we could (or collaborators could contribute) more adapters for this thing?

from styled-components.

geelen avatar geelen commented on May 4, 2024

Yeah right that's what peerDeps are for, right? I just thought they would complain if they were unfulfilled, so every time you npm i you get a warning that you're missing react-native?

from styled-components.

mxstbr avatar mxstbr commented on May 4, 2024

I just thought they would complain if they were unfulfilled, so every time you npm i you get a warning that you're missing react-native?

Ah yeah crap, good point. It's an optionalDependency!

from styled-components.

geelen avatar geelen commented on May 4, 2024

Closing in favour of #53

from styled-components.

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.