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

Can not define more than one rules for dynamically emotion css #23

Closed
nightire opened this issue Mar 25, 2018 · 2 comments
Closed

Can not define more than one rules for dynamically emotion css #23

nightire opened this issue Mar 25, 2018 · 2 comments

Comments

@nightire
Copy link

Consider this snippet:

import { computed } from 'ember-emotion';
import { isNone } from '@ember/utils';
import { alpha } from 'os-client/helpers/alpha';

const computeMaxWidth = context => {
  if (isNone(context.survey.theme)) return 'none';
  return context.survey.theme.container_width;
};

const computeBackground = context => {
  if (isNone(context.survey.theme)) return 'none';
  const { primary } = context.survey.theme;
  return `linear-gradient(to top, ${alpha([primary, 0.1])}, ${alpha([primary, 0.3])})`;
};

export const test = computed('survey.theme') `
  max-width: ${computeMaxWidth};
  background: ${computeBackground};
`;

I do not see any problems (or am I too dumb?) here, but the result is empty. However, if I remove max-width or background rule, the other one can be generated correctly. I am so confusing, where did I go wrong?

@alexlafroscia
Copy link
Owner

Hey -- sorry I never responded to this, I thought I had. I'm going to look into fixing this. Thanks for reporting!

@alexlafroscia
Copy link
Owner

🎉 This issue has been resolved in version 4.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants