Skip to content

Feature/fix responsive overrides #17 #18

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

Merged

Conversation

tdhooper
Copy link
Collaborator

Fixes #17

@simonsmith
Copy link
Owner

@tdhooper Sorry for my delay here. Will review this today or tomorrow. Thanks for your help again!

lib/index.js Outdated
// * The background definition has at-2x applied
function extractRetinaImage(identifier, background) {
const match = background.match(imageRegex);
const [image, type, value] = match;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check if match could be null here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot!

@simonsmith
Copy link
Owner

Great stuff. Cheers

@simonsmith simonsmith merged commit 6351f63 into simonsmith:master Jul 5, 2017
opened += open - close;
});
return backgrounds;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdhooper Curious about the intention of this function. Could the same not be achieved with return value.split(',')?

@tdhooper
Copy link
Collaborator Author

tdhooper commented Jul 5, 2017 via email

@tdhooper
Copy link
Collaborator Author

tdhooper commented Jul 6, 2017

Looking at this a bit more, for the given css:

.multi {
  background: url(http://example.com/image.png),
                    linear-gradient(to right, rgba(255, 255, 255, 0),  rgba(255, 255, 255, 1)),
                    green,
                    url(/public/images/cool.png) at-2x;
}

I don't think we should repeat green in the background-image rule we create, as it's not a valid image.

Instead, none makes more sense:

.multi {
  background-image: url(http://example.com/image.png),
                    linear-gradient(to right, rgba(255, 255, 255, 0),  rgba(255, 255, 255, 1)),
                    none,
                    url(/public/images/cool@2x.png);
}

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

Successfully merging this pull request may close these issues.

2 participants