issue123:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue123:c_c [2017/07/29 10:42] – créée d52fr | issue123:c_c [2017/08/10 17:12] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Last month, C&C focused on programming, | + | **Last month, C&C focused on programming, |
- | Since writing last month’s article, I have been working on a project for my degree, and in doing so, have spent a fair bit of time reading up on new CSS technologies (CSS Custom Properties and CSS Grids), as well as new features in the current version of Chrome which I think will be extremely helpful to developers. As such, I thought summarizing some of these will be useful for anyone who may have missed some of this news. For anyone curious, I get most of my news on these developments from CSS-Tricks (either via RSS or through twitter). | + | Since writing last month’s article, I have been working on a project for my degree, and in doing so, have spent a fair bit of time reading up on new CSS technologies (CSS Custom Properties and CSS Grids), as well as new features in the current version of Chrome which I think will be extremely helpful to developers. As such, I thought summarizing some of these will be useful for anyone who may have missed some of this news. For anyone curious, I get most of my news on these developments from CSS-Tricks (either via RSS or through twitter).** |
- | CSS | + | Le mois dernier, C&C s'est concentré sur la programmation, |
+ | |||
+ | Depuis le dernier article, je travaille sur un projet pour mon diplôme, et, ce faisant, j'ai passé un bon bout de temps à me documenter sur les nouvelles technologies de CSS (CCS Custom Properties - Propriétés personnalisées de CSS - et CCS Grids - Grilles CSS), ainsi que sur les nouvelles fonctionnalités de la version actuelle de Chrome qui, je le pense, seront extrêmement pratiques pour les développeurs. Ainsi, je pensais qu'un résumé de certaines de celles-ci serait utile à tous ceux qui auraient loupé une partie de ces informations. Pour toute personne curieuse, j'ai tiré la plupart de mes informations sur ces développements à partir de CSS-Tricks (via RSS ou Twitter). | ||
+ | |||
+ | **CSS | ||
Not that long ago, Flexbox support started taking off in all major browsers. And while Flexbox is a terrific option for laying things out in one direction (rows or columns, not both at once), it wasn’t really designed for laying out the entire web page’s structure. While it can be (and is) used for this, it results in different problems and hacks. It’s a definite improvement over float-based grids, but still not perfect. This is where CSS Grids come into play. They will allow you to create a CSS-based grid for your webpage. You define the rows and columns, even going so far as to giving them labels. And then you can assign elements to the rows and columns as you need (regardless of where they appear in the DOM). This makes it much easier to create the typical header/ | Not that long ago, Flexbox support started taking off in all major browsers. And while Flexbox is a terrific option for laying things out in one direction (rows or columns, not both at once), it wasn’t really designed for laying out the entire web page’s structure. While it can be (and is) used for this, it results in different problems and hacks. It’s a definite improvement over float-based grids, but still not perfect. This is where CSS Grids come into play. They will allow you to create a CSS-based grid for your webpage. You define the rows and columns, even going so far as to giving them labels. And then you can assign elements to the rows and columns as you need (regardless of where they appear in the DOM). This makes it much easier to create the typical header/ | ||
- | A couple of quick notes: the auto declaration (so the second row expands to fill the page) has given me a few issues in Firefox and Safari, where 100% seems to work. And the fr is a new fractional unit - meaning the column declaration is saying the sidebar is 1/4th the size of the body text column. | + | A couple of quick notes: the auto declaration (so the second row expands to fill the page) has given me a few issues in Firefox and Safari, where 100% seems to work. And the fr is a new fractional unit - meaning the column declaration is saying the sidebar is 1/4th the size of the body text column.** |
- | Naturally, as your site gets more complicated, | + | CSS |
- | The key benefit of this approach is the fact that you need only the media query to redefine the variables, and that the actual layout definition lines (in the body selector) never change. This makes it even easier to wrap the layout section in an @supports(display: grid) and have a fallback layout with Flexbox or normal floats. Due to the cascading nature of CSS, you can also overwrite these variables in a selector down the line (say you want to create a grid area in the .grid selector). You can simply redefine the variable, use them as above, and the changes will apply to only that element and its children. Now, does this replace preprocessor variables? In some things, I’d say yes. Anything dynamic or fluid that changes frequently (such as in media queries), then you can (and probably should) use CSS Custom Properties. For anything static | + | Il n'y a pas si longtemps, le support de Flexbox commençait à décoller dans tous les navigateurs Web majeurs. Et, alors que Flexbox est un choix sensationnel pour disposer les choses dans une seule direction |
- | Chrome DevTools | + | Deux courtes notes : la déclaration auto (de sorte que la seconde ligne s' |
- | Chrome version 59 brought with it some new additions | + | **Naturally, |
- | The main additions they cover are: | + | The key benefit of this approach is the fact that you need only the media query to redefine the variables, and that the actual layout definition lines (in the body selector) never change. This makes it even easier to wrap the layout section in an @supports(display: grid) and have a fallback layout with Flexbox or normal floats. Due to the cascading nature of CSS, you can also overwrite these variables in a selector down the line (say you want to create a grid area in the .grid selector). You can simply redefine the variable, use them as above, and the changes will apply to only that element and its children. Now, does this replace preprocessor variables? In some things, I’d say yes. Anything dynamic or fluid that changes frequently (such as in media queries), then you can (and probably should) use CSS Custom Properties. For anything static (such as defining a single brand color which you reuse frequently and will not change), then preprocessor variables are fine. Naturally, while support is new for the custom properties, you may want to consider defining fallbacks using your old preprocessor variables as well.** |
- | The ability to view CSS and JS coverage | + | Naturellement, |
- | This addition allows you to see a bar indicating how much of the loaded | + | |
- | Full Page Screenshots | + | Le premier bénéfice de cette approche est le fait que vous n'avez besoin que de la requête de média pour redéfinir les variables et que les vraies lignes de définition de la mise en page (dans le sélecteur du corps) ne changent jamais. Cela rend même plus facile l' |
- | For a long time when I needed to take screenshots of longer pages, I either used a 3rd party app, or else took a series of screenshots and stitched them together in the GIMP. Now, you can open the inspector, and enable the device toolbar | + | |
- | Blocking requests | + | **Chrome DevTools |
- | The last change I’m excited about is the ability to block an individual file, in order to see how your page loads without it. Occasionally, | + | |
- | Overall, this is a step into the future for CSS, and finally a chance for me to cut back on some of my development tools. If you have any cool use cases for CSS Grids or CSS Custom Properties you’d like to share with me (and our readers), then send me an email at lswest34+fcm@gmail.com. The same goes for any readers who may have questions, problems, or suggestions for future articles. | + | Chrome version 59 brought with it some new additions to the Chrome DevTools. They posted about the changes on their blog, which you can find here: https:// |
+ | The main additions they cover are: | ||
+ | The ability to view CSS and JS coverage | ||
+ | This addition allows you to see a bar indicating how much of the loaded CSS and JS was executed for a page load. This is ideal for seeing which methods or selectors you may want to move into a different file, which is included only on required pages. Or perhaps you can remove just unused styles and code. The inspector will even highlight the lines when viewing the file in the source panel.** | ||
+ | Les Chrome DevTools | ||
+ | La version 59 de Chrome apporte quelques nouveaux ajouts aux Chrome DevTools. Un message sur ces changements a été posté sur leur blog, que vous pouvez trouver ici : https:// | ||
+ | Les principaux ajouts qu'ils ont traités : | ||
+ | La possibilité de voir la couverture de CSS et JS. | ||
+ | Cet ajout vous permet de voir une barre indiquant la part des CSS et JS chargés qui a été exécutée au chargement d'une page. C'est idéal pour voir quelles méthodes ou sélecteurs vous pourriez vouloir déplacer dans un fichier différent, qui est inclus uniquement dans les pages nécessaires. Ou vous pouvez, peut-être, simplement supprimer les styles et code inutilisés. L' | ||
+ | **Full Page Screenshots | ||
+ | For a long time when I needed to take screenshots of longer pages, I either used a 3rd party app, or else took a series of screenshots and stitched them together in the GIMP. Now, you can open the inspector, and enable the device toolbar (which emulates mobile devices). The menu in the top right then offers you a few screenshot options. Naturally, if you want to screenshot the desktop view, you’ll want to set it to a responsive size, and expand the viewport to the desired layout. But it is possible (even if you use only the device toolbar for testing smaller viewports). It then takes the photo, and begins a download of it.** | ||
+ | Les copies d' | ||
+ | Pendant longtemps, quand j' | ||
+ | **Blocking requests | ||
+ | The last change I’m excited about is the ability to block an individual file, in order to see how your page loads without it. Occasionally, | ||
+ | Overall, this is a step into the future for CSS, and finally a chance for me to cut back on some of my development tools. If you have any cool use cases for CSS Grids or CSS Custom Properties you’d like to share with me (and our readers), then send me an email at lswest34+fcm@gmail.com. The same goes for any readers who may have questions, problems, or suggestions for future articles.** | ||
+ | Demandes de blocage | ||
+ | Le dernier changement qui m'a beaucoup plu est la possibilité de bloquer un fichier individuel, de façon à voir comment votre page se charge sans lui. Occasionnellement, | ||
+ | Globalement, | ||
- | Further Reading | + | |
+ | |||
+ | **Further Reading | ||
https:// | https:// | ||
Ligne 50: | Ligne 71: | ||
https:// | https:// | ||
- | https:// | + | https:// |
+ | |||
+ | Pour aller plus loin | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// |
issue123/c_c.1501317751.txt.gz · Dernière modification : 2017/07/29 10:42 de d52fr