投稿時間:2022-05-16 12:20:25 RSSフィード2022-05-16 12:00 分まとめ(23件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
ROBOT ロボスタ 配送・案内ロボット「KettyBot」を自動車ディーラーに導入 来店客を案内したりBYDの人気車種を紹介 https://robotstart.info/2022/05/16/pudu-byd.html 2022-05-16 02:27:50
IT ITmedia 総合記事一覧 [ITmedia Mobile] PCなしでCD楽曲をスマホに取り込める 「CDレコ6」の使い方を徹底解説 https://www.itmedia.co.jp/mobile/articles/2205/13/news028.html amazonmusicunlimited 2022-05-16 11:45:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] 会社員の6割が「給料に不満」 預貯金以外では「生命保険」「投信」に人気 https://www.itmedia.co.jp/business/articles/2205/16/news069.html ITmediaビジネスオンライン会社員の割が「給料に不満」預貯金以外では「生命保険」「投信」に人気転職エージェントのワークポート東京都品川区は、代のビジネスパーソンを対象に給料への満足度や、資産形成に関するアンケート調査を行った。 2022-05-16 11:12:00
TECH Techable(テッカブル) ゴムボートや浮き輪の膨らましが楽々! 片手サイズのポンプ「GIGA Pump 3.0」はランタン機能も https://techable.jp/archives/178599 gigapump 2022-05-16 02:00:15
python Pythonタグが付けられた新着投稿 - Qiita Python のマジックメソッドをオーバーライドして行列の四則演算を読みやすくする https://qiita.com/noritakaIzumi/items/71aab2f36ec01c2ccc68 print 2022-05-16 11:37:17
python Pythonタグが付けられた新着投稿 - Qiita フロベニウスの硬貨交換問題とその応用 https://qiita.com/masa0599/items/51c9b54e92c562fffcbf 数学の問題 2022-05-16 11:35:28
js JavaScriptタグが付けられた新着投稿 - Qiita Node.jsのトランスパイル時にESLintでエラーがあればBuild停止する設定をWebpackでやってみた https://qiita.com/yuta-katayama-23/items/840b3deb7d0f4149af9d build 2022-05-16 11:55:59
Ruby Railsタグが付けられた新着投稿 - Qiita rails5 progate 整理メモ https://qiita.com/masatom86650860/items/a899357e300a3fa49bd3 posts 2022-05-16 11:55:39
海外TECH DEV Community How to add Dark mode in Next.js Application using Tailwind CSS. https://dev.to/rashidalikalwar/how-to-add-dark-mode-in-nextjs-application-using-tailwind-css-49bg How to add Dark mode in Next js Application using Tailwind CSS Hey there In today s article I am going to show you how to add Dark mode to your Next js application using Tailwind CSS What is Next js Next js is a React based open source frontend framework with features like SSR Server Side Rendering and SSG Static Site Generation Next js also comes SEO optimized right out the box so you don t have to do it yourself from the scratch What is Tailwind CSS Tailwind CSS is utility first CSS framework for quickly building highly customizable User Interfaces with low level CSS This is great because it provides you an easy way to implement your web design and it only ships the CSS that is being used on the webpage which makes the whole app more light and efficient Here is how you can add Dark mode to your Next js application using Tailwind CSS Prerequisites Make sure you have Nodejs installed on your local machine Setting up a new Next js projectYou can skip this step if you already have one Run npx create next app nextjs tailwind in your terminal that should give you a new Next js project with following files You can use what ever name you prefer instead of nextjs tailwind Run cd nextjs tailwind to change directory and run npm run dev or yarn dev if you are using yarn to start your local developement server Go to http localhost There you will be able to see the following default Next js homepage Adding Tailwind CSSRun npm install D tailwindcss postcss autoprefixer It will install Tailwind CSS and all the necessary dependencies Then run npx tailwindcss init p It will create tailwind config js and postcss config js files Open tailwind config js and do the following code changes module exports content pages js ts jsx tsx src js ts jsx tsx theme extend plugins It will let Tailwind CSS know that on which files or folders it should be applied Now open styles globals css and add the following tailwind directives tailwind base tailwind components tailwind utilities Spin up you development server by running npm run dev Make following changes into your pages index js to see if Tailwind CSS is working export default function Home return lt div className pt mt gt lt div className flex justify center items center flex col gt lt div className max w sm bg white rounded lg border border gray shadow md mt gt lt a href gt lt img className rounded t lg src alt gt lt a gt lt div className p gt lt a href gt lt h className mb text xl font bold tracking tight text gray gt Laptops that you can t afford even in lt h gt lt a gt lt p className mb font normal text gray gt Lorem ipsum dolor sit amet Cum laudantium laborum ut saepe facilis aut rerum corporis qui debitis voluptas Rerum dolores aut voluptas galisum aut iure repellendus lt p gt lt a href className inline flex items center py px text sm font medium text center text white bg blue rounded lg hover bg blue focus ring focus outline none focus ring blue gt Read more lt svg className ml mr w h fill currentColor viewBox xmlns gt lt path fillRule evenodd d M a l a l a L Ha hl a z clipRule evenodd gt lt path gt lt svg gt lt a gt lt div gt lt div gt lt div gt lt div gt After this you should be able see a card with a image and some text If you are using VS CODE you can use Tailwind CSS IntelliSense for better development experience Adding Dark modeTo add dark mode we need to install few things next themes This package provides an easy to implement themes in Next js You can check more on that here This package is optional you can use text or SVGs directly if you want but I will install heroicons react It is an icon library which I will be using to make a theme toggle button Run the following command to install above packages npm install heroicons react next themes Edit app jsWrap the whole app with the ThemeProvider to use next themes import styles globals css import ThemeProvider from next themes function MyApp Component pageProps return lt ThemeProvider enableSystem true attribute class gt lt Component pageProps gt lt ThemeProvider gt export default MyApp Then go to tailwind config js and add darkMode class after content array module exports content pages js ts jsx tsx src js ts jsx tsx darkMode class theme extend plugins Note Technically you can hard code darkMode in tailwind config js and in the attribute of the ThemeProvider but since we want it to have state so I am using class It will update HTML head and tailwind with the current theme using the ThemeProvider s context Creating the theme toggle component Create a src folder in root directory of the project and inside that create a file with name ThemeToggler js Add following code import useTheme from next themes import useState useEffect from react import MoonIcon SunIcon from heroicons react outline const ThemeToggler gt const theme setTheme useTheme const mounted setMounted useState false useEffect gt setMounted true if mounted return null return lt button className w h bg blue rounded lg dark bg slate flex items center justify center hover ring ring blue transition all duration focus outline none onClick gt setTheme theme light dark light aria label Toggle Dark Mode gt theme light lt MoonIcon className text blue w h gt lt SunIcon className text blue w h gt lt button gt export default ThemeToggler Let me break it down for youI am using useTheme hook from next themes that provides two things one is theme which is just a string representing current theme and setTheme which is a method to change the current theme It is similar to useState hook Since our component gets rendered on server first so we have some hydration mismatch problem so in order to solve that I am checking if the component is mounted on the client side using React s useEffect hook In last I am using sun and moon icon to indicate actions with a simple JSX ternary operator How to add tailwind utility classes for dark mode So the way tailwind CSS dark mode works is similar to hover feature once you have decided how you want the element to look in dark mode you can just add dark in front of any utility classes that you wish to be activated in dark mode only Example lt p className text slate dark text slate gt This is some text lt p gt so text color will be slate if in light mode and slate if it is in dark mode Final stepsNow lets add ThemeToggler and some classes for dark mode in our homepage Open pages index js and add following code import ThemeToggler from src ThemeToggler export default function Home return lt div className pt mt gt lt div className flex justify center items center flex col gt lt ThemeToggler gt lt div className max w sm bg white rounded lg border border gray shadow md dark bg gray dark border gray mt transition duration gt lt a href gt lt img className rounded t lg src alt gt lt a gt lt div className p gt lt a href gt lt h className mb text xl font bold tracking tight text gray dark text white gt Laptops that you can t afford even in lt h gt lt a gt lt p className mb font normal text gray dark text gray gt Lorem ipsum dolor sit amet Cum laudantium laborum ut saepe facilis aut rerum corporis qui debitis voluptas Rerum dolores aut voluptas galisum aut iure repellendus lt p gt lt a href className inline flex items center py px text sm font medium text center text white bg blue rounded lg hover bg blue focus ring focus outline none focus ring blue dark bg blue dark hover bg blue dark focus ring blue gt Read more lt svg className ml mr w h fill currentColor viewBox xmlns gt lt path fillRule evenodd d M a l a l a L Ha hl a z clipRule evenodd gt lt path gt lt svg gt lt a gt lt div gt lt div gt lt div gt lt div gt If you have done every thing as mentioned you should be able to see something like below on the homepage The image can be random because I am using Unsplash API Also if you open browser s dev tools You will be able to see the current state of theme on your local storage Thanks for reading I hope you got something out of it if you have any questions or suggestions please feel free to comment below also don t forget to follow me on twitter 2022-05-16 02:34:43
海外科学 NYT > Science Total Lunar Eclipse and Blood Moon 2022: How to Watch https://www.nytimes.com/2022/05/15/science/total-lunar-eclipse-blood-moon-how-to-watch.html natural 2022-05-16 02:40:19
金融 ニュース - 保険市場TIMES 保険市場、トライアングル少額短期保険の「おまもりがわり」2商品を掲載開始 https://www.hokende.com/news/blog/entry/2022/05/16/120000 保険市場、トライアングル少額短期保険の「おまもりがわり」商品を掲載開始月日より掲載開始株式会社アドバンスクリエイトは、国内最大級の保険選びサイト「保険市場」に、トライアングル少額短期保険株式会社の「おまもりがわり」入院保険と「おまもりがわり」引受基準緩和型入院保険・無選択型入院保険を、年月日より掲載開始したと発表した。 2022-05-16 12:00:00
ニュース @日本経済新聞 電子版 サイゼリヤ、一部肉類メニューの販売終了 材料調達滞る https://t.co/RVZiNrfu1h https://twitter.com/nikkei/statuses/1526025075245187072 販売終了 2022-05-16 02:21:44
ニュース @日本経済新聞 電子版 インバウンド再開に罠 「中国依存」が呼ぶリスク https://t.co/TWqapxdi7m https://twitter.com/nikkei/statuses/1526022788766892032 中国依存 2022-05-16 02:12:39
ニュース @日本経済新聞 電子版 中国小売売上高、4月11%減 コロナ封鎖でマイナス拡大 https://t.co/BH8yVVFdse https://twitter.com/nikkei/statuses/1526020531316617216 小売 2022-05-16 02:03:41
ニュース ジェトロ ビジネスニュース(通商弘報) 欧州委、垂直的制限に関する一括適用免除規則を採択、電子商取引への対応強化 https://www.jetro.go.jp/biznews/2022/05/fc4d7df9e0d52a3a.html 電子商取引 2022-05-16 02:25:00
ニュース ジェトロ ビジネスニュース(通商弘報) 第2回新型コロナサミット開催、バイデン米大統領は議会に追加予算を再要請 https://www.jetro.go.jp/biznews/2022/05/4b50bcfd97d21aac.html 米大統領 2022-05-16 02:15:00
海外ニュース Japan Times latest articles The international monetary system is more unfit than ever https://www.japantimes.co.jp/opinion/2022/05/16/commentary/world-commentary/global-u-s-dollar-dominance/ neutral 2022-05-16 11:13:22
ニュース BBC News - Home Northern Ireland: PM poised for protocol change ahead of crisis talks https://www.bbc.co.uk/news/uk-northern-ireland-61456677?at_medium=RSS&at_campaign=KARANGA crisis 2022-05-16 02:05:48
サブカルネタ ラーブロ 新宿御苑前「虎辰」しょうゆらーめん http://ra-blog.net/modules/rssc/single_feed.php?fid=199175 丸の内線 2022-05-16 03:30:08
GCP Google Cloud Platform Japan 公式ブログ Google I/O: Google Cloud について知っておくべきこと https://cloud.google.com/blog/ja/products/application-modernization/google-cloud-at-io-2022-news-roundup/ また、Matthewは、PagerDutyなどのDevOpsツールをGoogleWorkspaceプラットフォームに簡単に接続できるようにすることで、どのように開発エクスペリエンスが改善されるかを紹介しました。 2022-05-16 03:00:00
北海道 北海道新聞 春の高校野球支部予選・5月16日の試合結果 https://www.hokkaido-np.co.jp/article/681213/ 春の高校野球 2022-05-16 11:21:00
北海道 北海道新聞 御柱祭、17mの柱立ち上がる 長野・諏訪大社で最終日 https://www.hokkaido-np.co.jp/article/681208/ 諏訪大社 2022-05-16 11:17:00
GCP Cloud Blog JA Google I/O: Google Cloud について知っておくべきこと https://cloud.google.com/blog/ja/products/application-modernization/google-cloud-at-io-2022-news-roundup/ また、Matthewは、PagerDutyなどのDevOpsツールをGoogleWorkspaceプラットフォームに簡単に接続できるようにすることで、どのように開発エクスペリエンスが改善されるかを紹介しました。 2022-05-16 03:00: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件)