<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Charles De Mount</title>
    <description>The latest articles on DEV Community by Charles De Mount (@codetaromiura).</description>
    <link>https://dev.to/codetaromiura</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F179965%2Fd3bd8132-5b46-48c6-bf0a-671b584da724.jpeg</url>
      <title>DEV Community: Charles De Mount</title>
      <link>https://dev.to/codetaromiura</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codetaromiura"/>
    <language>en</language>
    <item>
      <title>A Closer Look at the Firefox Console</title>
      <dc:creator>Charles De Mount</dc:creator>
      <pubDate>Thu, 21 May 2020 02:16:56 +0000</pubDate>
      <link>https://dev.to/codetaromiura/a-closer-look-at-the-firefox-console-45i6</link>
      <guid>https://dev.to/codetaromiura/a-closer-look-at-the-firefox-console-45i6</guid>
      <description>&lt;p&gt;In this second installment of the series exploring the developer tools within Firefox, we will look at some of the more interesting commands and keyboard shortcuts you can use to make your life easier while using the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Selecting Elements

&lt;ul&gt;
&lt;li&gt;$&lt;/li&gt;
&lt;li&gt;$$&lt;/li&gt;
&lt;li&gt;$0&lt;/li&gt;
&lt;li&gt;$_&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Inspecting Elements

&lt;ul&gt;
&lt;li&gt;keys()&lt;/li&gt;
&lt;li&gt;inspect()&lt;/li&gt;
&lt;li&gt;cd()&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Other useful commands

&lt;ul&gt;
&lt;li&gt;copy()&lt;/li&gt;
&lt;li&gt;clearHistory()&lt;/li&gt;
&lt;li&gt;:help&lt;/li&gt;
&lt;li&gt;:screenshot&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Bonus&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Selecting elements &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you have used jQuery, you might be familiar with using the &lt;code&gt;$&lt;/code&gt; for selecting DOM elements on the page. The console exposes different variations of that symbol as a quick way to reference objects in your document.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;$&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Is equivalent to the &lt;code&gt;document.querySelector&lt;/code&gt; method as it returns the first element in the document which matches the selector.&lt;/p&gt;

&lt;p&gt;Note that if you are using a library like the forementioned jQuery, using &lt;code&gt;$&lt;/code&gt; will call the function of the same name directly from the library instead.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JZaq18zU5M8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;$$&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Is equivalent to &lt;code&gt;document.querySelectorAll&lt;/code&gt; but, unlike that method, it will return an &lt;em&gt;array&lt;/em&gt; instead of a standard NodeList. Which means you have direct access to all the methods on the Array prototype such as &lt;code&gt;forEach&lt;/code&gt;, &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, etc…&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s5oDIQfcCjE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;$0&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Will return the currently Inspected element on the page. It is one you are likely to use often every time you want a quick glance at a specific node.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ndxGv0eAxJs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;$_&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Will return the result of the last expression executed in the console's command line. It is very handy to know when making adjustments directly from the console.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8lfjH2OxWvw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspecting elements &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;keys()&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When passed an object as an argument, this function returns an array of the keys on that object. In this sense, it is the console's equivalent to the &lt;code&gt;Object.keys&lt;/code&gt; method.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/h_36hSqc5yA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;inspect()&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This function takes an object as an argument and opens the inspector for that object. At first this can seem like a roundabout way to do things, but I assure you it can be amazing when using the console within the debugger as we'll see in the next chapter.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/v_IwXG7WCZc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;cd()&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Think of this as the &lt;code&gt;cd&lt;/code&gt; command from your usual command line. The &lt;code&gt;cd&lt;/code&gt; function in the console allows you to switch between execution context from the top-level document to any of the embedded iframes within it. There are 3 ways you can use it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass the iframe DOM element&lt;/li&gt;
&lt;li&gt;Pass a CSS selector that matches the frame&lt;/li&gt;
&lt;li&gt;Pass the iframe's global window object&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To return to the top level document, again like in your usual command line, simply run the function with no arguments.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/N8nYGJ5RFEQ"&gt;
&lt;/iframe&gt;
&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2KKOCZPIUYU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;While writing this, I learned that the cd command will be deprecated in a future release. Play with it while you can!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Other useful commands &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;copy()&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This function will copy the argument you pass to it to your clipboard.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/CQndASVTfr4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;clearHistory()&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You can research the console history using &lt;code&gt;F9&lt;/code&gt; (&lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;R&lt;/code&gt; on macOS) and enter part of an expresion. Continuing to type &lt;code&gt;F9&lt;/code&gt; (&lt;code&gt;Ctrl&lt;/code&gt;+ &lt;code&gt;R&lt;/code&gt; on macOS) cycles backwards through the matches, while &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;F9&lt;/code&gt; (&lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;S&lt;/code&gt;) will search &lt;em&gt;forward&lt;/em&gt; in the list of matches.&lt;/p&gt;

&lt;p&gt;You can thus clear the history by using the &lt;code&gt;clearHistory&lt;/code&gt; command.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;:help&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This command will bring you to the MDN help page for the console in a new tab. Use it whenever you feel like getting a refresher on the commands or checking some of the other commands not discussed in this article.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;:screenshot&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You can and probably should mostly use the GUI in the contextual tab bar menu to take a screenshot of webpages, but the developers at Mozilla thought of giving developers an easy access to the same functionality within the console with even more powers.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3sKUmswkRbs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;By default, executing &lt;code&gt;:screenshot&lt;/code&gt; within the console will take a screenshot of the viewport and save it as a png file with the name encoded as ... . But it accepts a set of arguments to make it even more powerful.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--clipboard&lt;/code&gt; will save the screenshot to your clipboard instead of saving it to your downloads folder.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--delay&lt;/code&gt; takes a the number of seconds to delay the screenshot for.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--dpr&lt;/code&gt; specifies the device pixel ratio use when taking the screenshot as the number passed to it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--fullpage&lt;/code&gt; will take a screenshot of the entire document instead of the visible area only.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--selector&lt;/code&gt; will take a selector and only include the matching element(s) in the screenshot.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--file&lt;/code&gt; will save the file to your specified downloads folder even if the &lt;code&gt;--clipboard&lt;/code&gt; flag was enabled. You will then end up with a copy to the clipboard and also the file saved in your prefered location.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In fact, using the following command now&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;:screenshot --filename 'firefox-console-article.png' --file --clipboard --selector '#article-show-container' --delay 0.5&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 should put an image named 'firefox-console-article.png' in your downloads folder &lt;em&gt;and&lt;/em&gt; your clipboard after a delay of half a second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Instead of using the &lt;code&gt;clear()&lt;/code&gt; function over and over again to clear the terminal it is best to use the &lt;code&gt;Ctrl + L&lt;/code&gt; to do so. Again, just like in bash or zsh.&lt;/li&gt;
&lt;li&gt;The console can be toggled from any of the other dev tools by using the &lt;code&gt;Esc&lt;/code&gt; key.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Next, we will take a look at the debugger and how you can use it with the console to speed up your debugging process. Until then, take care!&lt;/p&gt;

</description>
      <category>firefox</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>10 Tips about the Firefox Page Inspector</title>
      <dc:creator>Charles De Mount</dc:creator>
      <pubDate>Sun, 03 May 2020 21:42:59 +0000</pubDate>
      <link>https://dev.to/codetaromiura/10-tips-about-the-firefox-page-inspector-4oej</link>
      <guid>https://dev.to/codetaromiura/10-tips-about-the-firefox-page-inspector-4oej</guid>
      <description>&lt;p&gt;Firefox is my browser of choice for anything involving web development. The developer edition comes with a plethora of tools and niceties which make working, with CSS especially, a breeze.&lt;/p&gt;

&lt;p&gt;While everyone raves about tools like the fantastic Grid and Flex Inspectors, or the fonts and changes panels, I felt like there was a gap in my knowledge of the browser to use it to its full potential. So I embarked on a journey of reading all the entries about Firefox on MDN and found cool features which could enhance your development experience.&lt;/p&gt;

&lt;p&gt;This is the first part of a series where we will take a look at each of the tools within Firefox.&lt;/p&gt;

&lt;p&gt;For now we will focus on the Inspector tool, a best friend of mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shift-Click on the color swatch to change the displayed format
&lt;/h2&gt;

&lt;p&gt;Color formats can be tricky to work with when making small changes for accessibility in particular. An HEX value doesn't tell us much about a specific color besides its hue, thankfully we can toggle between different formats right in the browser.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UwA-GzLacL8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If the color in question is used as a foreground color, the color picker menu also provides the contrast rating based on &lt;a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html" rel="noopener noreferrer"&gt;WAI-ARIA&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6ilezmn425lf6ugp6c7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6ilezmn425lf6ugp6c7.gif" alt="Checking accessibility with the color picker" width="410" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Move the location of Absolutely positioned elements
&lt;/h2&gt;

&lt;p&gt;The joke about centering an element being difficult in CSS might not be longer true with all the introduction of flex and grid properties, but absolutely positioned elements can still be tricky to work with. &lt;/p&gt;

&lt;p&gt;You can go about nudging numbers, but why not do it optically? Clicking the target icon in the layout panel allows you to do just that.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/0lpE99U0Hl8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Talking about nudging numbers, you can use &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;Up&lt;/code&gt; / &lt;code&gt;Down&lt;/code&gt; to increment by a factor of 10, &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Up&lt;/code&gt; / &lt;code&gt;Down&lt;/code&gt; to increment values by 0.1, and &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;Page up&lt;/code&gt; / &lt;code&gt;Page down&lt;/code&gt; to increment values by 100.&lt;/p&gt;

&lt;h2&gt;
  
  
  Editing filters
&lt;/h2&gt;

&lt;p&gt;Clicking on the gray and white swatch next to a &lt;code&gt;filter&lt;/code&gt; property in the Rules View will open a filter editor displaying all the effects applied by that filter individually. You can also add, remove, reorder effects, and even &lt;em&gt;save&lt;/em&gt; some for later using the drop-down menu at the bottom.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/nn494X0y-JI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/grayghostvisuals/full/cgFGm" rel="noopener noreferrer"&gt;Grayscale Filter&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Editing timing functions
&lt;/h2&gt;

&lt;p&gt;When defining an animation or a transition, the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function" rel="noopener noreferrer"&gt;timing function&lt;/a&gt; might need some tweaks. In the past I would have to use a website like &lt;a href="https://cubic-bezier.com" rel="noopener noreferrer"&gt;this one&lt;/a&gt; to define a better one and update my code before testing it again within the browser. &lt;/p&gt;

&lt;p&gt;Thankfully there is a tool in Firefox which allows you to set them directly by clicking the cubic Bézier swatch. You can decide to try modify the current curve or try one of the presets as a starting point. Neat, uh?&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/_nt4dbwOD_s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Monitoring animations
&lt;/h2&gt;

&lt;p&gt;The animations panel is really useful when working with complex animations that involve a number of elements and properties.&lt;/p&gt;

&lt;p&gt;Clicking on an element will open a bottom panel from which we can analyze the components of the running animation. Animation properties which are optimized through the compositor have a lighting bolt icon next to them while hovering on the animation. If they aren't, a message explaining the cause will appear instead.&lt;/p&gt;

&lt;p&gt;If your CSS animations seem to stutter, or lack in smoothness, taking a look there might be a good idea.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6u1xwpC1prQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Restict matches when searching
&lt;/h2&gt;

&lt;p&gt;It is sometimes helpful to search for a particular property name or rule in the Rules view to filter styles. By default, the search will highlight all the items containing the query. For example, if you wanted to look for the &lt;code&gt;flex&lt;/code&gt; keyword, you'd obtain all results including &lt;code&gt;flex-direction&lt;/code&gt; or &lt;code&gt;flex-flow&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But what if you only wanted to highlight the &lt;code&gt;flex&lt;/code&gt; shorthand property instead. You can surround the query with &lt;em&gt;backticks&lt;/em&gt; to restrict the match. &lt;em&gt;Et voilà!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Toggling classes
&lt;/h2&gt;

&lt;p&gt;Classes that have been assigned to an element can be quickly toggled using the &lt;code&gt;.cls&lt;/code&gt; selector on top of the Rules view. It's so useful and easy to access, I don't know why I don't see it used often enough.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-7owTWyWN_8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Manipulating Shapes
&lt;/h2&gt;

&lt;p&gt;This feature is so awesome and complex that it would need an entire article to cover it. But it is just too good not to mention. &lt;/p&gt;

&lt;p&gt;Using the Shape Path Editor when using either the &lt;code&gt;shape-outside&lt;/code&gt; or &lt;code&gt;clip-path&lt;/code&gt; properties allows for easy creation of simple to complex shapes within your CSS.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/u9bDe3Bw0sA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.bitsrc.io/8-little-videos-about-the-firefox-shape-path-editor-96a12c7cd3b6" rel="noopener noreferrer"&gt;8 little videos about the Firefox shape path editor&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick referencing
&lt;/h2&gt;

&lt;p&gt;I don't know about you but I only go to the computed panel when something is going very wrong in the cascade. Well, selecting an element in the Computed panel and pressing &lt;code&gt;F1&lt;/code&gt; will open its reference page in MDN. How cool is that?&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/f7PL9F1EDFE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Re-using the element picker
&lt;/h2&gt;

&lt;p&gt;Using the element picker &lt;code&gt;Shift + Cmd + C&lt;/code&gt;, the default behavior exits the tool right after a single selection. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pzhEqnsUxB8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;It is possible to continue selecting elments by holding the Shift key. The tool will return to its default behavior once you let go of the key.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s2rySZZPO8A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;And that's it for today. Next, we'll talk about my other best friend, the console panel. &lt;/p&gt;

&lt;p&gt;I hope you found something useful, what's your favorite thing about the inspector tool that I haven't mentioned?&lt;/p&gt;

</description>
      <category>firefox</category>
      <category>webdev</category>
      <category>css</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
