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

Support for passing an array of styles as extra attributes #3542

Merged
merged 12 commits into from
Feb 17, 2024

Conversation

misaf
Copy link
Contributor

@misaf misaf commented Feb 16, 2024

This PR adds support for passing an array of styles when rendering a Media Model:

Media::first()->img('thumb', ['styles' => [
    'background-color: blue',
    'color: blue'
]]),

Under the hood, it uses Laravel's Arr::toCssStyles helper method.

@freekmurze
Copy link
Member

Could you add a tests and documentation for this?

Add a test to check if the 'styles' attribute works correctly
@misaf
Copy link
Contributor Author

misaf commented Feb 16, 2024

Sure, I'll make sure to add tests and documentation for this feature.

@misaf
Copy link
Contributor Author

misaf commented Feb 16, 2024

Tests and documentation have been added as requested.

@freekmurze
Copy link
Member

It seems the tests are failing. Could you have a look?

@misaf
Copy link
Contributor Author

misaf commented Feb 17, 2024

All tests are green!

@freekmurze freekmurze merged commit d94b110 into spatie:main Feb 17, 2024
9 checks passed
@freekmurze
Copy link
Member

Thanks!

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