Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove drop shadow in Addon-Info #1877

Closed
t2 opened this issue Sep 21, 2017 · 17 comments
Closed

Remove drop shadow in Addon-Info #1877

t2 opened this issue Sep 21, 2017 · 17 comments

Comments

@t2
Copy link

t2 commented Sep 21, 2017

The addon-info inline styling is very strange. Header and prop types are split into separate shadowed containers. Is this on purpose?

Example: https://cl.ly/0h0W0g0T1p1b

@ItsJonQ
Copy link

ItsJonQ commented Sep 21, 2017

I noticed this as well. I couldn't override it via the styles config. I had to abandon it :(

@t2
Copy link
Author

t2 commented Sep 21, 2017

@ItsJonQ Me as well. Moved over to Styleguidist. Maybe someone will clean this up a bit.

@ItsJonQ
Copy link

ItsJonQ commented Sep 21, 2017

@t2 Oo! Thanks for the recommendation. I'll seriously consider this option! My needs have grown from needing a simple playground to something more of a styleguide.

Thanks!

@danielduan
Copy link
Member

We would love a PR for that if you any of you have time to give a try at fixing it.

@Hypnosphi
Copy link
Member

I believe #1501 fixes that

@danielduan
Copy link
Member

@Hypnosphi #1501 wouldn't fix this, but it would eliminate this problem because it won't be inline anymore.

@SuperOl3g
Copy link
Contributor

SuperOl3g commented Oct 6, 2017

@danielduan In common case we can just add style properties for each element of components (like this).

But it's very inflexible solution. For example, now I want to add a light-gray background for each odd row in PropTable.
Inline styles can't do this, we need the power of CSS! ⚡️

AFAIU from #1576 you are planning to separate visual part from logic.
Did you think about CSS modules, styled components, styletron or another CSS-in-JS solution with the possibility of theming?

@Hypnosphi
Copy link
Member

Hypnosphi commented Oct 7, 2017

@SuperOl3g We actually use glamorous (this is basically styled-components with JS objects instead of CSS string literals)

@SuperOl3g
Copy link
Contributor

SuperOl3g commented Oct 7, 2017

@Hypnosphi Hmm, it's kind of theming but very very limited.
With this solution, we can theme the only what we preset to theming. It also doesn't give the possibility to overwrite any styles :<

@SuperOl3g
Copy link
Contributor

Hope #428 will solve not only the problem of theming of the core but also theming of add-ons too.

@danielduan
Copy link
Member

danielduan commented Oct 7, 2017

I think if you're looking for an inline style guide type react tool, perhaps you should take a look at react-styleguidist: https://react-styleguidist.js.org/

I'd hate for you to leave Storybook but I think it might suit your use case better in its current implementation. You will lose out on Storybook's ecosystem of addons though.

@Hypnosphi
Copy link
Member

Hypnosphi commented Oct 7, 2017

very very limited

It's actually the same as in styled-components which you have brought up

we can theme the only what we preset to theming

In my view, it's actually a good thing. But anyway, we could just do something like this for all the components:

const Title = glamorous.h1({
  fontSize: '10px'
}, ({theme}) => ({
  color: theme.main.color,
  ...theme.Title
}))

Here, theme.Title will override everything

@SuperOl3g
Copy link
Contributor

@Hypnosphi, sounds good! Look forward when it will be released)

@Hypnosphi
Copy link
Member

@SuperOl3g you can actually bring that moment closer! Just clone the release/3.3 branch, pick some component from lib/ui/modules/ui/components, and move it to lib/components replacing inline styles with glamorous stuff. Join us in slack once you have any questions: https://now-examples-slackin-nqnzoygycp.now.sh/

@SuperOl3g
Copy link
Contributor

@Hypnosphi, ok, if I have some time, I will migrate some code

cjies added a commit to iCHEF/gypcrete that referenced this issue Oct 13, 2017
Since the inline styling is damn strange now, header and preview parts are split into separate shadowed containers.

Issue: storybookjs/storybook#1877
cjies added a commit to iCHEF/gypcrete that referenced this issue Oct 13, 2017
Since the inline styling is damn strange now, header and preview parts are split into separate shadowed containers.

Issue: storybookjs/storybook#1877
@SuperOl3g
Copy link
Contributor

@Hypnosphi, I'm not very good at glamorous so maybe you know how to add theme styles only for :nth-child(odd) via glamorous?)

@Hypnosphi
Copy link
Member

Like this:

{
  ':nth-child(odd)' {
    /* your styles */
  }
}

What do you want to use it for, by the way?

@danielduan danielduan changed the title addon-info Inline Display Issue Remove drop shadow in Addon-Info Mar 23, 2018
@danielduan danielduan self-assigned this Mar 23, 2018
@issue-sh issue-sh bot removed the todo label Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants