投稿時間:2023-02-02 22:19:34 RSSフィード2023-02-02 22:00 分まとめ(23件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] PS5の品不足、「焦点はデリバリーに移った」とソニーGの十時社長 https://www.itmedia.co.jp/news/articles/2302/02/news215.html itmedianewsps 2023-02-02 21:43:00
python Pythonタグが付けられた新着投稿 - Qiita 未経験からデータアナリストへ転職する為には? https://qiita.com/renrenrenren/items/9d83ffa9abfd7e247e59 転職 2023-02-02 21:49:37
python Pythonタグが付けられた新着投稿 - Qiita Djangoでプロジェクトを作成しローカルサーバーを起動してみた https://qiita.com/_h_idiot_/items/71c1e75cc87554881da8 django 2023-02-02 21:46:26
python Pythonタグが付けられた新着投稿 - Qiita pyminizipでcompress_multipleを使わずに複数のファイルをまとめる方法 https://qiita.com/nakamumu/items/b27a568ebb8261511e78 compressmultiple 2023-02-02 21:36:05
python Pythonタグが付けられた新着投稿 - Qiita Gitを作ってみる(理解編) https://qiita.com/noshishi/items/60a6fe7c63097950911b commit 2023-02-02 21:33:24
js JavaScriptタグが付けられた新着投稿 - Qiita [React]コンポーネントをpdf出力させる https://qiita.com/www_y118/items/c7a0f1422d3c1d265703 canvas 2023-02-02 21:41:01
js JavaScriptタグが付けられた新着投稿 - Qiita useStateの実装とuuidを用いたユニークなキーの設定 https://qiita.com/ysk-s/items/fb3e3e4130a828b11098 usestate 2023-02-02 21:07:07
Git Gitタグが付けられた新着投稿 - Qiita Gitを作ってみる(理解編) https://qiita.com/noshishi/items/60a6fe7c63097950911b commit 2023-02-02 21:33:24
技術ブログ Developers.IO VPCピアリングを使って別アカウントにあるVPC内のRDSに接続してみた https://dev.classmethod.jp/articles/vpc-peering-to-connect-to-vpc-rds-on-another-account/ 構成 2023-02-02 12:26:20
海外TECH MakeUseOf 9 Signs Your Laptop Has Water Damage & What You Should Do Next https://www.makeuseof.com/signs-your-laptop-has-water-damage/ doesn 2023-02-02 12:16:15
海外TECH DEV Community Best Practices for Utility-First CSS https://dev.to/machy8/best-practices-for-utility-first-css-mod Best Practices for Utility First CSSUtility First CSS is a modern and flexible approach to styling website However it temps developers to step on the gas turn on the heavy metal and write literally everything into class attributes in completely random order This ends up with a class long like Route and coding turns into a Sherlock Holmes experience This guide is a list of useful lessons learned while working and testing Utility First CSS It s goal is to help you use Utility First CSS effectively while eliminating the issues mentioned below Even though this guide is focused primarily on Stylify CSS there are links to Tailwind documentation for similar technology approach and all tips explained in this guide can be used within any other Utility First CSS framework that supports similar features Table of content Utility First Pros and ConsHow to align and sort selectorsCleaning bloated templates and duplicated class attributesCreating reusable ComponentsStyling elements globallyEliminating Hardcoded Values by VariablesSimplifying development using hooksCSS bundles splitting Utility First CSS Pros and ConsBelow is a list of a few pros and cons you will probably encounter when working with Stylify CSS or Tailwind CSS I have explained them more in a detail on Stylify CSS website Pros It allows you to atomically style every element on the page exactly how you needYou don t have create weird selector names switch between files clean unused CSS etc There are fewer duplicated property values and at rules in the CSSThe CSS is often smaller than with manually written CSS or with component frameworksCons Class attributes in templates can get easily unreadable Some elements that should work as components buttons for example are defined as elements with duplicated class attributes which can cause harder maintenanceValues for properties like color border and margin are often hardcoded within the templateNow when we know at least some positives negatives while using Utility First CSS let s take a look at the negatives and let s try to solve them How to align and sort selectorsTo improve class attribute readability order your selectors from the smallest media query screen container to largest lt Min width gt lt button class font size px sm font size px lg font size px gt lt button gt lt Max width gt lt button class maxwpx margin top px tomd flex direction column gt lt button gt In case the class attribute is long and you have multiple media queries within the attribute put each media query on a separate line This way you can easily see which line is responsible for each media container query and what changed in the pull request lt div class width px height px margin bottom px md margin bottom px md width px xl width gt lt div gt If there are multiple attributes on an element and a class attribute with a lot of utilities put the class attribute on the end and break it into multiple lines This will keep the element more readable lt div id aria label data my custom data class width px height px margin bottom px md margin bottom px md width px xl width gt lt div gt When it comes to selectors that are related to each other like font size line height and width height put them right next to each other This way it is easier to find related selectors lt button class font size px line height px width height px gt lt button gt lt button class display flex flex direction column align items center font size px line height px md flex direction row md font size px gt lt button gt If you use Tailwind you might want to check their Prettier Plugin which can sort your classes automatically To decrease the number of classes you can also use shortcuts and modern CSS features to avoid unnecessary classes lt div class margin top px margin right px font size px md font size px xl font size px gt lt div gt lt div class margin px px font size clamp px vh px gt lt div gt Cleaning bloated templates and duplicated class attributesBecause of the simplicity of utilities usage it s easy to forget to split the code into reusable parts Unfortunately we cannot avoid this if we don t want to have unreadable templates We can style elements globally for which we can use global custom selectors or components When using frameworks like React Vue Svelte or Angular we can easily create framework based components with slots In Stylify case we can also define components within a config file or within a file template where they are used If you use Tailwind you can configure components within CSS files with the apply rule They have their guide about reusing styles adding custom styles and extending configuration Each of these approaches has its purpose which is explained below Creating reusable ComponentsIn case you work with frameworks like Nuxt Next Vue React Svelte or Lit you can define components and reuse them This way you have styles for such components only in one place and it doesn t bloat your HTML elsewhere Also you can restrict the amount of possible component style variants by rendering the component based on passed props MyButton vue lt template gt lt button class color red font size px gt lt slot gt lt slot gt lt button gt lt template gt Page vue lt template gt lt MyButton gt Click me lt MyButton gt lt template gt Similar approach can also be used within PHP frameworks like Symfony Laravel or Nette It might not be as flexible as React or Vue components but you can create a lot of reusable blocks Styling elements globallySometimes it s necessary to style elements globally Such as styling nested elements within an article or adding some CSS reset In Stylify this can be done in various ways using custom selectors If you use Tailwind there are arbitrary variants for this When you have only a small amount of selectors and elements to modify it s ok to style it directly through the class attribute lt nav class display flex flex direction column a display inline flex align items center text decoration none a icon margin right px line height a span font size px a hover span text decoration underline gt lt a href gt lt i class icon gt lt i gt lt span gt Link lt span gt lt a gt lt nav gt When the style you have to add to inner global elements starts to grow it s better to move it outside of the class attribute In Stylify CSS you can define these selectors within the config file or in a template where they are used In case the style is applied only in one template we can define it within the template The custom selectors can be defined within a comment in the stylify customSelectors section It expects a javascript object without surrounding brackets The syntax within the template literals is similar to SCSS However to keep things simple it only supports nesting and chaining Custom selectors content options expects javascript object without surrounding brackets lt stylify customSelectors navigation display flex flex direction column a display inline flex align items center text decoration none icon margin right px line height span font size px amp hover span text decoration underline stylify customSelectors gt lt nav class navigation gt lt a href gt lt i class icon gt lt i gt lt span gt Link lt span gt lt a gt lt nav gt The config from template can also be moved into the config file const compilerConfig customSelectors navigation display flex flex direction column a display inline flex align items center text decoration none icon margin right px line height span font size px amp hover span text decoration underline Eliminating Hardcoded Values by VariablesAt first it seems ok to write selector like color or box shadow px px rgba However what if we want to use the same shadow across the web or somewhere in the future we will want to support a light dark mode This will simply not work and it will complicate the maintenance and refactoring If you use Tailwind they have an extensive guide on how to configure each part of the framework In the case of Stylify there is nothing like a theme There are only variables that can be defined in two ways If variable is used globally put it in the global config const compilerConfig variables textColor shadow px px rgba If it is used locally configure it within a comment in a file where it is used using content options It expects javascript object without surrounding brackets lt stylify variables textColor shadow px px rgba stylify variables gt You can reuse these variables in multiple places like this lt span class color textColor box shadow shadow gt Hello World lt span gt When you need to modify the font or color based on screen or color theme preference use CSS variables to flexibly change colors font sizes background and other properties based on screen and media query This will decrease the number of selectors and will simplify the refactoring const compilerConfig CSS variables are note enabled by default in Stylify replaceVariablesByCssVariables true variables variabels textFontSize px textColor Tries to match a screen can be sm md lg minwpx textFontSize px For a media prefer color scheme dark dark textColor fff When screen is not found it falls back to a custom selector in this case element with the dark class which will very probably be the root html el dark textColor fff And in HTML lt span class font size textFontSize color textColor gt lt span gt Tailwind has a Dark Mode guide in their docs so make sure to check it out In their case you can use for example a class to switch themes Simplifying development using hooksTo eliminate some repetitive tasks you can use the Stylify CSS Hooks system Stylify provides various hooks within the Compiler Bundler and Runtime These hooks can be used to attach listeners with which you can for example Dynamically generate a style guideModify Convert Extend values of new selector matchesModify bundler outputTrigger some callback within a browser when Stylify generates initial CSSEtc Below is an example of a hook that listens to a new macro match for font size This hook checks whether the font size value is in the allowed range and converts px units to REM It also attaches correct line height so we don t have to add line height selector every time we want to use font size selector import hooks from stylify stylify Create a function that will work with font size propertyconst fontSizeHandler selectorProperties gt const propertyValue selectorProperties properties font size If value of the font is for example a default reset to REM do nothing Or if the unit are not pixels for example if propertyValue propertyValue endsWith px return const numberValue Number propertyValue match d Let s create allowed font sizes const allowedFontSizes Small text Regular text Large text Subtitle Title Large title Extra large title If developer tries to use for example font size px it will throw an error if Object values allowedFontSizes includes numberValue throw new Error Font size propertyValue is not allowed Available values are JSON stringify allowedFontSizes const pixelFontSize Number pixelUnit slice const remFontSize pixelFontSize Also recalculate px to rem and add a correct line height So we don t have to add it manually each time selectorProperties addMultiple font size remFontSize rem line height remFontSize pixelFontSize gt rem Add it into the handlersconst newMacroMatchHandlers font size fontSizeHandler Add a hook that listens to new macro match get s appropriate handler and calls ithooks addListener compiler newMacroMatch macroMatch selectorProperties gt const selectorProperties Object keys data selectorProperties properties for const selectorProperty of selectorProperties const handler newMacroMatchHandlers selectorProperty undefined if handler undefined continue handler data CSS bundles splittingStylify CSS allows you to split CSS bundles basically for each file separately This feature brings increases the level of CSS optimization to the next level as the bundles can get very small Split CSS for App sectionsLet s say you have app sections One for the front of the website and another for admin user dashboard For sections only CSS files will be generated The CSS for the frontend will not be loaded into admin and vice versa Split CSS for Layouts and pagesThis way you have one CSS import for the layout and one for the page When you load a page the layout and page CSS will be loaded This happens for every other page except the layout CSS is now cached CSS Layers and ScopesIf you decide to split CSS into multiple files for layouts pages you might encounter a problem with overridden CSS selectors Luckily this problem has an easy solution We use CSS layers and Scope to correct the specificity Tailwind has it s own solution for CSS layers so make sure to check their guide Stylify CSS provides CSS layers support within bundle configuration This configuration can be used within Stylify Unplugin for Next React Vue Vite SvelteKit Symfony Laravel Nette and etc and Stylify Astro Astro build Both of these packages use Stylify Bundler package under the hood Common configuration for Stylify Unplugin Astro integration and Bundler const bundlerConfig cssLayersOrder This will generate layer layout page order layout page This tells Stylify to export the above layers order only into bundles that has layout CSS layer exportLayer layout const layoutBundle files path to layout html outputFile path to layout css cssLayer layout const pageBundle files path to page html outputFile path to page css cssLayer page const config bundler bundlerConfig bundles layoutBundle pageBundle Usage of this configuration with unplugin import stylifyVite stylifyWebpack stylifyEsbuild stylifyRollup from stylify unplugin stylifyVite config stylifyWebpack config stylifyEsbuild config stylifyRollup config Example with Astro build integration import stylify from stylify astro export default integrations stylify config Example with direct bundler usage import Bundler from stylify bundler const bundler new Bundler config bundler bundle await bundler waitOnBundlesProcessed Let me know what you think If you like the idea let me know that by starring Stylify repo ️ Do you have any other best practices you use Is there anything missing in the docs Doe s anything need more explanation I will be happy for any feedback The Stylify is still a new Library and there is a lot of space for improvement Also a big thanks go to Posandu Mapa for his cooperation on this article 2023-02-02 12:51:48
Apple AppleInsider - Frontpage News 16-inch MacBook Pro with M2 Max review: Newfound performance, in same great design https://appleinsider.com/articles/23/02/02/16-inch-macbook-pro-with-m2-max-review-newfound-performance-in-same-great-design?utm_medium=rss inch MacBook Pro with M Max review Newfound performance in same great designApple s update to the inch MacBook Pro adds the M Max to an already fantastic notebook a change to satisfy creators and power users inch MacBook Pro with M MaxThe inch MacBook Pro is the powerhouse in the portable Mac range Its position as the largest notebook in the catalog and its ability to be configured with a powerful chip makes it a desirable item for both creators and power users Read more 2023-02-02 12:58:28
Apple AppleInsider - Frontpage News China could 'weaponize' TikTok, so another Senator calls for ban https://appleinsider.com/articles/23/02/02/china-could-weaponize-tiktok-so-another-senator-calls-for-ban?utm_medium=rss China could x weaponize x TikTok so another Senator calls for banColorado Senator Michael Bennet has asked Apple and Google to immediately ban TikTok from the App Store over national security concerns TikTok on a smartphoneBennet a Democrat on the Senate Intelligence Committee wrote to Apple and Google on Thursday according to the New York Times Read more 2023-02-02 12:29:14
海外TECH Engadget The Morning After: Everything Samsung revealed at its Unpacked event https://www.engadget.com/the-morning-after-everything-samsung-revealed-at-its-unpacked-event-2023-galaxy-s23-ultra-121532856.html?src=rss The Morning After Everything Samsung revealed at its Unpacked eventSamsung s first big tech event of unveiled three phones and three laptops The showstoppers are predictably the company s premium flagships the Galaxy S series The S Ultra has a huge inch an S pen stylus and a megapixel camera That s a lot of pixels It s the company s first Adaptive Pixel sensor which means while you can still shoot at MP by default the system uses pixel binning to deliver brighter clearer pictures at MP or MP Other upgrades include optical image stabilization that s been effectively doubled for better lit photos and less shaky video Meanwhile the Galaxy S starting at and S are slightly more iterative but still premium smartphones They pack reliable cameras and faster processors the entire S series has a special overclocked version of Qualcomm s Snapdragon Gen All the phones are available to pre order now Samsung also revealed an ultra laptop The inch Galaxy Book Ultra draws inspiration from the company s best selling Galaxy S phones but combines it with heavy hitting PC specs like th gen Intel Core i processors and NVIDIA s GeForce RTX graphics Mat SmithThe Morning After isn t just a newsletter it s also a daily podcast Get our daily audio briefings Monday through Friday by subscribing right here The biggest stories you might have missedSamsung is making extended reality wearable devices How to pre order the Samsung Galaxy S Ultra and the rest of the S seriesOpenAI starts offering a paid ChatGPT plan for per monthJony Ive designed a perfect Red Nose for charitySony has now shipped over million PSs following blockbuster holiday salesFTC fines drug discount app GoodRx for sharing user information with Facebook and GoogleAI generated Seinfeld is pretty awfulAt least it s inadvertently entertaining Nothing ForeverWhat if AI made never ending Seinfeld “Nothing Forever uses OpenAI s GPT natural language model to produce occasionally coherent dialog between pixelated characters Jerry George Elaine and Kramer One creator posted to Reddit “Aside from the artwork and the laugh track you ll hear everything else is generative including dialogue speech direction camera cuts character focus shot length scene length etc character movement and music The stream has little human involvement and changes based on viewer feedback from the Twitch stream Continue reading Sony is killing its PlayStation Plus collection on May thIf you own a PS claim the games before then Since September Sony s PlayStation Plus Collection has offered a bunch of PS greatest hits to PlayStation owners with an active PS Plus membership It included God of War The Last of Us Remastered Resident Evil and more Alas come May th Sony is shuttering the PlayStation Plus Collection saying it plans to focus on bringing more games to its various tiers of PS Plus Make sure you download any of the titles now while they re still there Continue reading Facebook now has billion usersThe social network is still growing Almost years in Facebook is still growing Meta reported alongside its fourth quarter earnings it has now reached two billion daily users While Facebook isn t the first Meta owned platform to reach that number WhatsApp recently crossed two billion DAUs it does show the company s biggest source of ad revenue is still growing During a call with analysts Zuckerberg suggested Meta will continue to make cuts as it prioritizes efficiency “We re going to be more proactive about cutting projects that aren t performing or may no longer be as crucial he said The CEO also said generative AI would be a priority for Meta in the year ahead He added “One of my goals for Meta is to build on our research to become a leader in generative AI Continue reading 2023-02-02 12:15:32
海外科学 NYT > Science How to See the ‘Green Comet’ on Thursday https://www.nytimes.com/article/green-comet-watch.html stone 2023-02-02 12:31:28
海外科学 BBC News - Science & Environment Why have there been no named winter storms this year? https://www.bbc.co.uk/news/uk-64454569?at_medium=RSS&at_campaign=KARANGA storms 2023-02-02 12:18:14
ニュース BBC News - Home UK to see shorter recession, says Bank of England https://www.bbc.co.uk/news/business-64487179?at_medium=RSS&at_campaign=KARANGA englandthe 2023-02-02 12:40:01
ニュース BBC News - Home British Gas admits agents break into struggling customers' homes https://www.bbc.co.uk/news/business-64491243?at_medium=RSS&at_campaign=KARANGA meters 2023-02-02 12:36:41
ニュース BBC News - Home Green comet captured from back garden https://www.bbc.co.uk/news/uk-england-nottinghamshire-64499694?at_medium=RSS&at_campaign=KARANGA bramcote 2023-02-02 12:28:26
ニュース BBC News - Home BBC News channel announces chief presenter line-up for revamp https://www.bbc.co.uk/news/entertainment-arts-64496388?at_medium=RSS&at_campaign=KARANGA channels 2023-02-02 12:08:20
ニュース BBC News - Home Why haven't we seen any major winter storms? https://www.bbc.co.uk/news/uk-64454569?at_medium=RSS&at_campaign=KARANGA haven 2023-02-02 12:18:14
ニュース BBC News - Home UK interest rates: How high could they go and how the rise affects you? https://www.bbc.co.uk/news/business-57764601?at_medium=RSS&at_campaign=KARANGA interest 2023-02-02 12:28:56
ニュース BBC News - Home What is happening to house prices and could there be a crash? https://www.bbc.co.uk/news/explainers-63147101?at_medium=RSS&at_campaign=KARANGA house 2023-02-02 12:19:04

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)