投稿時間:2022-07-23 06:15:29 RSSフィード2022-07-23 06:00 分まとめ(14件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Git Gitタグが付けられた新着投稿 - Qiita 【Git】グローバルな.gitignoreを設定する方法 https://qiita.com/P-man_Brown/items/89f03e9f4de4bba62915 configgitignoreds 2022-07-23 05:41:16
海外TECH DEV Community Take styled-components to the next level https://dev.to/everlyhealth/take-styled-components-to-the-level-34b5 Take styled components to the next levelMost of us have been aware of CSS in JS libraries since around and they have come a long way since The top libraries that most people are familiar with are styled components and emotion They have mostly the same API and syntax and for this article I won t go into the differences between the two One of the main benefits that CSS in JS for this article I ll mainly reference styled components provides is the ability to write quite obviously CSS in javascript files This is usually either through using a template string like import styled from styled components const Container styled div background color white …as well as using a Javascript object import styled from styled components const Container styled div backgroundColor white This especially changed the game for the React world because now we can pass props to these styled components for contextual use casesimport styled from styled components const Container styled div props gt backgroundColor props mode light white black const MyComponent gt const mode useThemeContext return lt Container mode mode gt lt Container gt No more messing with classes and CSS Sass Less files PitfallsThe flexibility of styled components is great for developers to get started using it but it can also create problems for large teams that may not have the best communication standards and best practices in place Some developers may use the template literals while others use CSS objects This can cause some inconsistency in how design tokens are utilized and can cause one off values that can make it difficult to update according to a set theme This is where styled system can help with giving CSS in JS more structure to help build a robust design system component library What is styled systemStyled System lets you quickly build custom UI components with constraint based style props based on scales defined in your theme It allows for style props to be added directly to styled components so that it doesn t need to be done manually It also hooks into the theme in a type safe way to take the guesswork out of what type of variable should be used according to the design system lt Box fontSize th index in theme fontSizes rem rem rem rem fontWeight bold p rd index in theme spacing px px px px px mb color white bg primary contextual color value at the theme level gt Hello World lt Box gt How does this help Why would we want to add something like this to the way we already do things with styled components First class themingWhen working with styled components we often use the styled function that is offered With this function we can define what type of HTML element we want to use To take that even further we can even add styles to any React component granted it accepts and passes the className to the component s underlying elements import styled from styled components import colors from design const Container styled div background color white color colors green border color props gt props theme primaryColor As you can see we have three different ways to define a color And the right way may not be so apparent especially to someone who is not familiar with the code base This ambiguity allows for theming to be a second class citizen and for it to seem acceptable to have many one off values in a few cases it can be acceptable So what if there is only one real way to define this color two if you d like to consider the escape hatch css prop as an option lt Box with Typescript we can restrict these values to what is a part of the theme bg white color green borderColor primaryColor gt lt Box gt These three values come directly from the theme object if it were to look like this export const theme colors white fff green ea primaryColor ea ResponsivenessWe live in a world that has so many devices and devices sizes to access the web And because all those different devices have their own screen sizes our site needs to be responsive to be able to provide an elegant user interface for each of those devices To do so we utilize media queries and show styling based on the different device screen sizes The way we currently do that with styled components looks like this import styled from styled components import size mediaQueries from design const Container styled div margin top size sm px sometimes we forget about handling the mobile size mediaQueries forTabletVerticalUp margin top size md px sometimes we forget about handling the large desktop size With styled system almost every prop comes with a scaled value option meaning we can easily give a value for each defined breakpoint Let s say our theme breakpoints are set up likeexport const theme breakpoints px px px px mobile tablet desktop large desktop size px sm px md px lg px We can write our components like below without having to wrap styled around it and manually set the media queries lt Box marginTop sm md sm for mobile md for everything larger gt lt Box gt Atomic DesignAtomic Design is a design concept that web elements should build upon each other like atoms molecules organisms and so on This concept is a bit tough to achieve with styled components alone because with the styled method we tend to extend components constantly just to add some styling When we extend these base components like that we are essentially trying to recreate the atom with different protons and neutrons and to any newcomer it looks like a new atom With styled system we maintain the base components as much as possible by relying on specialization which means adding different prop values to add a specialization to a more generic component This way as the team grows and new developers look at the codebase it is more apparent what the underlying HTML markup is and what the intentions are To explain an example a button element is an atoma styled system styled component Button is a moleculecomponents that ingest a Button would be an organisma collection of organisms that make up an experience would be a templatetemplates make up a page Downsides to styled systemNot actively maintainedUnfortunately the styled system repo on Github is not actively maintained but that doesn t mean it s useless This just means that no further improvements or fixes will be made and if the tool does not need any fixes then that s okay styled system is super lightweight and does not have any real shipped dependencies Essentially it s a collection of methods that can be added to either styled components or emotion to enable various style props This is why the package size is kb which is pretty small Other alternatives are more robustThe creators of styled system also have created theme ui which is a more full fledged and more fledge ness coming soon than styled system The main difference between the two is that theme ui is opinionated to use emotion under the hood and is not compatible with styled components read more Both of them do use the System UI specification as well as a few more that you can find here ConclusionI believe the concept of styled system is huge especially when paired with Typescript in developing a robust design system and component library It allows for defining the styles inline with the component instead of somewhere else which can make writing CSS less painful especially if Typescript can tell you variables you have to pick from and it doesn t give you an option to veer away from it unless you really try hard And because it allows you to make your components more strict when it comes to what design token options it accepts the more resilient to change they are as those tokens can be changed in one place and that change updates all the components respectively since they have to use the tokens and not one off values So if you work with a large group and would like to avoid rewriting the same styles and CSS values I would highly recommend styled system or any of the other libraries using the System UI specification happycoding 2022-07-22 20:35:00
Apple AppleInsider - Frontpage News MacBook Air with M2 processor review: The sweet spot for Mac portables in 2022 https://appleinsider.com/articles/22/07/16/macbook-air-with-m2-processor-review-the-sweet-spot-for-mac-portables-in-2022?utm_medium=rss MacBook Air with M processor review The sweet spot for Mac portables in Apple s redesign of the MacBook Air incorporating the M Apple Silicon processor makes it the best option for most people who want to own a portable Mac The MacBook AirThe M MacBook Air is once again one of the initial Macs to be released as part of an Apple Silicon generation After leading the charge for the M Apple s using it again for the M Read more 2022-07-22 20:21:56
海外TECH Engadget 'The Lord of the Rings: The Rings of Power' trailer hints at Sauron's return https://www.engadget.com/the-lord-of-the-rings-the-rings-of-power-comic-con-trailer-201045059.html?src=rss x The Lord of the Rings The Rings of Power x trailer hints at Sauron x s returnAmazon is determined to generate buzz for its blockbuster series The Lord of the Rings The Rings of Power and that includes a large new trailer to kick off San Diego Comic Con The three minute clip sheds considerably more light on the story and to no one s surprise sets the stage for Sauron s appearance While the show will start by highlighting the relative peace of Middle earth s Second Age it will quickly become clear that Sauron is coming back ーand that factions will have to unite if they hope to stop the Dark Lord As the title makes clear the series will focus on the forging of the Rings of Power so crucial to J R R Tolkien s fantasy world You can also expect to learn more about the rise and fall of the island nation of Númenor Clips shown at Comic Con offered peeks at a younger Elrond harfoots ancestors to hobbits and Arondir The Rings of Power debuts September nd on Prime Video It s still too soon to say if the reported billion production budget will pay off for Amazon However the internet behemoth clearly isn t taking chances Talk show host and Tolkien fan Stephen Colbert opened the Comic Con panel alongside an orchestral performance led by composer Bear McCreary Amazon expects its Lord of the Rings saga to be a hit and it s willing to spend lavishly on both the production and the marketing 2022-07-22 20:10:45
ニュース BBC News - Home Ukraine war: Deal signed to allow grain exports to resume by sea https://www.bbc.co.uk/news/world-europe-62268070?at_medium=RSS&at_campaign=KARANGA separate 2022-07-22 20:13:44
ニュース BBC News - Home Dover travellers warned they face weekend delays https://www.bbc.co.uk/news/uk-england-kent-62273523?at_medium=RSS&at_campaign=KARANGA dover 2022-07-22 20:51:12
ニュース BBC News - Home Sebastian Kalinowski: Mother and partner guilty of murdering teenage son https://www.bbc.co.uk/news/uk-england-leeds-62163849?at_medium=RSS&at_campaign=KARANGA august 2022-07-22 20:45:20
ニュース BBC News - Home England v South Africa: Thrilling bowling display helps hosts level ODI series https://www.bbc.co.uk/sport/cricket/62273573?at_medium=RSS&at_campaign=KARANGA England v South Africa Thrilling bowling display helps hosts level ODI seriesA thrilling bowling performance helps England level the one day international series against South Africa with an emphatic run win in a rain affected game at Emirates Old Trafford 2022-07-22 20:19:28
ビジネス ダイヤモンド・オンライン - 新着記事 近畿大が新設「情報学部」で下克上!?“プレステの父”が明かす成算【久夛良木健学部長インタビュー】 - 大学2022 劇変の序列・入試・就職 https://diamond.jp/articles/-/306463 久夛良木 2022-07-23 05:25:00
ビジネス ダイヤモンド・オンライン - 新着記事 大阪公立大ついに始動!国立王国・関西の大学序列で「下克上」なるか - 大学2022 劇変の序列・入試・就職 https://diamond.jp/articles/-/306462 公立大学 2022-07-23 05:20:00
ビジネス ダイヤモンド・オンライン - 新着記事 量子コンピューター「特許数」ランキング【世界トップ20】5位グーグル、日本勢は? - 号砲! 量子レース https://diamond.jp/articles/-/306343 量子コンピューター「特許数」ランキング【世界トップ】位グーグル、日本勢は号砲量子レース量子コンピューターを開発する“実力を示す有力な指標の一つが特許数だ。 2022-07-23 05:10:00
ビジネス ダイヤモンド・オンライン - 新着記事 西郷隆盛に学ぶ、「スター人材が辞めない会社」が絶対に守る3つのルール - 小宮一慶の週末経営塾 https://diamond.jp/articles/-/306835 小宮一慶 2022-07-23 05:05:00
北海道 北海道新聞 押収手製銃を発射実験へ 殺傷能力確認、製造容疑も https://www.hokkaido-np.co.jp/article/709206/ 奈良県警 2022-07-23 05:29:48
ビジネス 東洋経済オンライン インドで1位のスズキ「5位のトヨタ」と提携の訳 小型車のスズキ×電動化のトヨタが生む果実 | トレンド | 東洋経済オンライン https://toyokeizai.net/articles/-/605514?utm_source=rss&utm_medium=http&utm_campaign=link_back 東洋経済オンライン 2022-07-23 05:30:00

コメント

このブログの人気の投稿

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

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

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)