The extension that we created in Chapter 6, Write Magento 2.0 Extensions – a Great Place to Go, tweets about extension and has the following appearance:

Let's improve the CSS extension rules to turn it into a mobile-friendly one.
Using Chrome DevTools or Responsive Web Designer Tester, select an Apple iPhone 5—portrait device to test our code optimization.
Open the module.less file available under the packt/app/code/Packt/TweetsAbout/view/frontend/web/css/source directory and add the following code:
/*Tweets About Style*/
@media (min-width: 960px){
#wrapper {
width: 90%;
max-width: 1100px;
min-width: 800px;
margin: 50px auto;
}
#columns {
-webkit-column-count: 3;
-webkit-column-gap: 10px;
-webkit-column-fill: auto;
-moz-column-count: 3;
-moz-column-gap: 10px;
-moz-column-fill: auto;
column-count: 3;
column-gap: 15px;
column-fill: auto;
}
}
.tweet {
display: inline-block;
background: #FEFEFE;
border: 2px solid #FAFAFA;
box-shadow: 0 1px 2px rgba(34, 25, 25, 0.4);
margin: 0 2px 15px;
-webkit-column-break-inside: avoid;
-moz-column-break-inside: avoid;
column-break-inside: avoid;
padding: 15px;
padding-bottom: 5px;
background: -webkit-linear-gradient(45deg, #FFF, #F9F9F9);
opacity: 1;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
-o-transition: all .2s ease;
transition: all .2s ease;
}
.tweetimg {
width: 15%;
display:block;
float:left;
margin: 0px 5px 0px 0px;
}
.tweet p {
font: 12px/18px Arial, sans-serif;
color: #333;
margin: 0;
}
#columns:hover .img:not(:hover) {
opacity: 0.4;
}After saving the module.less file, change the tweets.phtml code available under packt/app/code/Packt/TweetsAbout/view/frontend/templates, change the file with this new code, and save it, as follows:
<?php
$tweets = $block->searchTweets();
?>
<div id="wrapper">
<div id="columns">
<?php foreach ($tweets as $tweet){ ?>
<div class="tweet">
<p>
<a href="https://twitter.com/intent/user?user_id=<?php echo $tweet->user->id; ?>" target="_blank">
<img src="<?php echo $tweets->user->profile_image_url; ?>" alt="profile">
<?php echo $tweet->user->name; ?>
</a>
<br />
Created: <?php echo $tweets->created_at; ?>
<br /><br />
<a href="<?php echo isset($tweet->entities->urls[0]->url) ? $tweet->entities->urls[0]->url : "#"; ?>" target="_blank"><?php echo $tweet->text;?></a>
<?php echo $tweets->text;?>
</a>
</p>
</div>
<?php } ?>
</div>
</div>To deploy the module update, follow this recipe:
packt/bin directory.php magento module:enable --clear-static-content Packt_TweetsAbout command.php magento setup:upgrade command.php magento setup:static-content:deploy command.write permissions again to the directories (var and pub).Now, test the tweets about extension by accessing http://localhost/packt/tweetsabout to see the new responsive look, as shown in the following screenshot:

If you activate DevTools and choose an iPhone 5 device, you will see a result similar to the following screenshot:
