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

add @media keyword to stylesheet exports #281

Merged
merged 2 commits into from Jan 22, 2019
Merged

add @media keyword to stylesheet exports #281

merged 2 commits into from Jan 22, 2019

Conversation

mktcode
Copy link
Contributor

@mktcode mktcode commented Jan 17, 2019

fixes part of #273

@@ -1391,7 +1391,7 @@ public function exportStyleSheet(DataContainer $dc)
// Add the media query (see #7560)
if ($objStyleSheet->mediaQuery != '')
{
$objFile->append($objStyleSheet->mediaQuery . ' {');
$objFile->append('@media ' . str_replace('@media ', '', $objStyleSheet->mediaQuery) . ' {');
Copy link
Member

Choose a reason for hiding this comment

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

Adding @media in the "Media query" field will break the front end, therefore we do not need the str_replace().

@leofeyer leofeyer added the bug label Jan 18, 2019
@leofeyer leofeyer added this to the 4.4.34 milestone Jan 18, 2019
@mktcode
Copy link
Contributor Author

mktcode commented Jan 21, 2019

I don't understand. This method is only used to send a file to the browser, for the export functionality in the backend. Do I miss something here?

@leofeyer
Copy link
Member

$objStyleSheet->mediaQuery can never contain @media, otherwise the generated <style> tag in the front end would be invalid. Therefore the str_replace() is unnecessary.

@mktcode
Copy link
Contributor Author

mktcode commented Jan 21, 2019

Ahhh okay.... gotya!

@leofeyer leofeyer merged commit 95f8021 into contao:4.4 Jan 22, 2019
@leofeyer
Copy link
Member

Thank you @mktcode.

@mktcode mktcode deleted the patch-1 branch January 23, 2019 09:43
@leofeyer leofeyer modified the milestones: 4.4.34, 4.4 May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants