Styling Options For React Applications | Lecture 204 | React.JS ð¥
Summary
TLDRãã®ãããªã¹ã¯ãªããã§ã¯ãReactã¢ããªã±ãŒã·ã§ã³ãã¹ã¿ã€ã«ä»ãããããã®æ§ã ãªæ¹æ³ã«ã€ããŠè©³ãã解説ããŠããŸãããããŸã§ã¯å€éšCSSãã¡ã€ã«ã䜿çšããŠããŸããããä»åã®ãããžã§ã¯ãã§ã¯CSSã¢ãžã¥ãŒã«ãæ¡çšããŸããReactã¯ã¹ã¿ã€ã«ä»ãã«é¢ããç¬èªã®èŠè§£ãæã£ãŠããããå€ãã®ã¹ã¿ã€ã«ãªãã·ã§ã³ãæäŸãããµãŒãããŒãã£ã©ã€ãã©ãªãååšããŸããã€ã³ã©ã€ã³ã¹ã¿ã€ã«ãå€éšCSSãCSSã¢ãžã¥ãŒã«ãJavaScriptå ã®CSSïŒstyled componentsãªã©ïŒããããŠTailwindã®ãããªãŠãŒãã£ãªãã£ãã¡ãŒã¹ããã¬ãŒã ã¯ãŒã¯ãããã«ã¯UIã³ã³ããŒãã³ãã©ã€ãã©ãªïŒMaterial UIãChakra UIãªã©ïŒãçšããã¹ã¿ã€ã«ä»ãã玹ä»ãããŠããŸããCSSã¢ãžã¥ãŒã«ã¯ã³ã³ããŒãã³ãããšã«ã¹ã¿ã€ã«ãå®çŸ©ããä»ã®ã³ã³ããŒãã³ããšå¹²æžããªãå©äŸ¿æ§ãæã¡ãReactã®ã³ã³ããŒãã³ãæåã®èãæ¹ã«æ²¿ã£ãŠããŸãã
Takeaways
- ð CSSã¯ãŠã§ãã¢ããªã±ãŒã·ã§ã³ã®ã¹ã¿ã€ã«ä»ãã«ãããŠéèŠãªèŠçŽ ã§ãã
- ð Reactã§ã¯ãå€ãã®ã¹ã¿ã€ã«ä»ããªãã·ã§ã³ãçšæãããŠãããããã¯ReactããŠã§ãã¢ããªã±ãŒã·ã§ã³ã®ã¹ã¿ã€ã«ä»ãã«é¢ããŠæèŠãæããªããšããåºæ¬çãªå²åŠããæ¥ãŠããŸãã
- ðš ãããŸã§ã¯å€éšCSSãã¡ã€ã«ãã°ããŒãã«ã«å«ããŠããŸããããä»åã®ãããžã§ã¯ãã§ã¯CSSã¢ãžã¥ãŒã«ã䜿çšããŸãã
- ð ã€ã³ã©ã€ã³ã¹ã¿ã€ã«ã¯Reactã§ã¯ããäžè¬çã§ãããããã®JSXèŠçŽ ã«é©çšãããããŒã«ã«ã¹ã³ãŒãã«ãªããŸãã
- ð å€éšCSSãã¡ã€ã«ã¯ã°ããŒãã«ã¹ã¿ã€ã«ãæäŸãã倧ããªãããžã§ã¯ãã§ã¯ã¯ã©ã¹ã®è¡çªã管çãå°é£ã«ãªãå¯èœæ§ããããŸãã
- ð ãããã§ãã·ã§ãã«ãªãããžã§ã¯ãã§ã¯ãCSSã¯ã»ãšãã©ãã°ããŒãã«ã§ã¯ãªããåã ã®ã³ã³ããŒãã³ãã«ã¹ã³ãŒããããŸãã
- ðŠ CSSã¢ãžã¥ãŒã«ã¯ãåã³ã³ããŒãã³ãã«å¯ŸããŠ1ã€ã®CSSãã¡ã€ã«ãæžãããšã§ãã¹ã¿ã€ã«ããã®ã³ã³ããŒãã³ãã«ã®ã¿ã¹ã³ãŒãããŸãã
- ð» CSS in JSã©ã€ãã©ãªïŒäŸïŒstyled-componentsïŒã䜿ããšãJavaScriptãã¡ã€ã«å ã§CSSãæžãããšãã§ããŸããããã¯Reactã®ã³ã³ããŒãã³ãã«ã¹ã¿ã€ã«ãçŽæ¥é©çšããããšãã§ããŸãã
- ð ïž Tailwindã®ãããªãŠãŒãã£ãªãã£ãã¡ãŒã¹ãCSSãã¬ãŒã ã¯ãŒã¯ã䜿ããšã JSXããŒã¯ã¢ããããé¢ããããšãªãUIå šäœãèšèšã§ããŸãã
- ð UIã³ã³ããŒãã³ãã©ã€ãã©ãªïŒäŸïŒMaterial UI, Chakra UI, MantineïŒã䜿çšãããšãCSSãæžããã«ãããžã§ã¯ãå šäœãæ§ç¯ã§ããŸãã
- ð ãã®ãããžã§ã¯ãã§ã¯CSSã¢ãžã¥ãŒã«ãæ¢çŽ¢ããReactã¢ããªã±ãŒã·ã§ã³ãã¹ã¿ã€ã«ä»ãããããŸããŸãªæ¹æ³ã«ã€ããŠåŠã³ãŸãã
Q & A
ãªãReactã¢ããªã±ãŒã·ã§ã³ã«ã¯å€ãã®ç°ãªãã¹ã¿ã€ã«èšå®æ¹æ³ãããã®ã§ããããïŒ
-Reactã¯å€ãã®ãŠã§ãã¢ããªã±ãŒã·ã§ã³éçºã«ãããäžè¬çãªåŽé¢ã«å¯ŸããŠæèŠãæããªããšããåºæ¬çãªå²åŠãæã£ãŠããããã®äžã€ãã¹ã¿ã€ã«èšå®ã§ããReactã¯ã¢ããªã±ãŒã·ã§ã³ã®ã¹ã¿ã€ã«æ¹æ³ã«ã€ããŠäœãæ°ã«ããŸããã®ã§ãå€ãã®ç°ãªãã¹ã¿ã€ã«èšå®ãªãã·ã§ã³ãååšããã»ãšãã©ããµãŒãããŒãã£ã©ã€ãã©ãªã«ãã£ãŠæäŸãããŠããŸãã
Reactã«ãããã€ã³ã©ã€ã³ã¹ã¿ã€ã«ãšã¯äœã§ãã©ã®ãããªå©ç¹ããããŸããïŒ
-Reactã«ãããã€ã³ã©ã€ã³ã¹ã¿ã€ã«ã¯ãJSXèŠçŽ ã«styleããããã£ã䜿çšããŠçŽæ¥CSSãé©çšããæ¹æ³ã§ããããã¯Reactã®æžå¿µç¹ã®åé¢ã®èãæ¹ã«ãããããäžè¬çã§ããã€ã³ã©ã€ã³ã¹ã¿ã€ã«ã¯ãã®JSXèŠçŽ ã«ããŒã«ã«ã¹ã³ãŒããããŠããããã®ç¹å®ã®èŠçŽ ã®ã¿ã«é©çšããããããã¹ã¿ã€ã«ã®è¡çªãé²ãããšãã§ããŸãã
ã°ããŒãã«CSSã䜿çšããéã®æœåšçãªåé¡ã¯äœã§ããïŒ
-ã°ããŒãã«CSSã§ã¯ãã¢ããªã±ãŒã·ã§ã³å ã®ãã¹ãŠã®JSXèŠçŽ ãå€éšCSSãã¡ã€ã«å ã®ã¯ã©ã¹ã䜿çšã§ããããã倧ããªãããžã§ã¯ãã§ã¯åé¡ãçºçãããããªããŸããã¯ã©ã¹ã®æŽæ°ãæ°ããã¯ã©ã¹ã®è¿œå ãä»ã®ã³ã³ããŒãã³ãã«åœ±é¿ãäžããããšããããŸãããã®ããã倧èŠæš¡ãªã¢ããªã±ãŒã·ã§ã³ã§ã¯ã°ããŒãã«CSSã¯é¿ããã¹ãã§ãã
CSSã¢ãžã¥ãŒã«ãšã¯äœã§ãã©ã®ãããªå©ç¹ããããŸããïŒ
-CSSã¢ãžã¥ãŒã«ã¯éåžžã®CSSãã¡ã€ã«ãšäŒŒãŠããŸãããåã³ã³ããŒãã³ãã«å¯ŸããŠ1ã€ã®CSSãã¡ã€ã«ãæžãããšã§ããã®ãã¡ã€ã«å ã®ã¹ã¿ã€ã«ããã®ã³ã³ããŒãã³ãã«ã®ã¿ã¹ã³ãŒããããŸããããã«ãããã³ã³ããŒãã³ããããã¢ãžã¥ãŒã«åããåå©çšæ§ãé«ãŸããReactã®æžå¿µç¹ã®åé¢ãããããåæ ããŸãã
styled-componentsã®ãããªCSS in JavaScriptã©ã€ãã©ãªãšã¯äœã§ãã©ã®ãããªç¹åŸŽããããŸããïŒ
-CSS in JavaScriptã©ã€ãã©ãªã¯ãJavaScriptãã¡ã€ã«å ã§CSSãæžãæ¹æ³ã§ããã³ã³ããŒãã³ããšåããã¡ã€ã«å ã§ã¹ã¿ã€ã«ãå®çŸ©ããReactã³ã³ããŒãã³ãã«çŽæ¥ã¹ã¿ã€ã«ãé©çšããããšãã§ããŸããããã¯Reactã®å²åŠãå®å šã«åãæ¢ããŠãããã³ã³ããŒãã³ãã¯ãã®å€èŠ³ã«é¢ãããã¹ãŠã®æ å ±ãã€ãŸãCSSãå«ãã¹ãã ãšè¿°ã¹ãŠããŸãã
Tailwindã®ãããªãŠãŒãã£ãªãã£ãã¡ãŒã¹ãCSSãã¬ãŒã ã¯ãŒã¯ãšã¯äœã§ãã©ã®ãããªå©ç¹ããããŸããïŒ
-Tailwindã¯ããŠãŒãã£ãªãã£ã¯ã©ã¹ã䜿çšããŠåã ã®ã¹ã¿ã€ã«ãå®çŸ©ãããã¬ãã¯ã¹ããã¯ã¹ã䜿çšããŠã¬ã€ã¢ãŠããã¬ã¹ãã³ã·ãã«ãããããããŒå¹æãäœæãããããŸãã§JSXããŒã¯ã¢ãããé¢ããããšãªãUIå šäœããã¶ã€ã³ã§ããããã«ããCSSãã¬ãŒã ã¯ãŒã¯ã§ãã
CSSãå šãæžããUIã³ã³ããŒãã³ãã©ã€ãã©ãªã䜿çšããããšã®å©ç¹ãšã¯äœã§ããïŒ
-Material UIãChakra UIãMantineãªã©ã®UIã³ã³ããŒãã³ãã©ã€ãã©ãªã䜿çšãããšãã»ãšãã©ã®ãŠã§ãã¢ããªã±ãŒã·ã§ã³ã§äžè¬çã§ãããã¬ãã«ããã€ãã¬ã¹ã¿ã€ã«ã®ã³ã³ããŒãã³ããå©çšã§ããŸããããã¯åå¿è ã«ã¯çæ³çã§ã¯ãããŸããããåŸã§æ¢çŽ¢ãã䟡å€ããããããããŸããã
Reactã¢ããªã±ãŒã·ã§ã³ãã¹ã¿ã€ã«èšå®ããéã«äœ¿çšã§ãããªãã·ã§ã³ã¯ä»ã«ãããŸããïŒ
-ã¯ããä»ã«ãSassãã¡ã€ã«ã®äœ¿çšãå€éšCSSãã¡ã€ã«ããã®ã¯ã©ã¹ã®é©çšãªã©ãæããããŸãããããã倧èŠæš¡ãªãããžã§ã¯ãã«ãããŠã¯ãCSSã¢ãžã¥ãŒã«ãCSS in JavaScriptã©ã€ãã©ãªãªã©ã®ããŒã«ã«ã¹ã³ãŒãã®ã¹ã¿ã€ã«èšå®æ¹æ³ãæšå¥šãããŸãã
CSSã¢ãžã¥ãŒã«ã䜿çšããéã«åã³ã³ããŒãã³ãã«ã¹ã³ãŒããããã¹ã¿ã€ã«ãäœæããå©ç¹ã¯äœã§ããïŒ
-CSSã¢ãžã¥ãŒã«ã䜿çšããããšã§ãã¹ã¿ã€ã«ããã®ã³ã³ããŒãã³ãã«ã®ã¿ã¹ã³ãŒããããä»ã®ã³ã³ããŒãã³ãã§ã¯äœ¿çšã§ããªããããã¹ã¿ã€ã«ã®è¡çªãé²ããã¢ããªã±ãŒã·ã§ã³ã®ä¿å®æ§ãšæ¡åŒµæ§ãé«ããããšãã§ããŸãã
Reactã¢ããªã±ãŒã·ã§ã³ã®ã¹ã¿ã€ã«èšå®ã«ãããŠããªãReactã¯ã¹ã¿ã€ã«æ¹æ³ã«æèŠãæããªãã®ã§ããããïŒ
-Reactã¯ãŠã§ãã¢ããªã±ãŒã·ã§ã³éçºã«ãããå€ãã®äžè¬çãªåŽé¢ã«å¯ŸããŠæèŠãæããªããšããåºæ¬çãªå²åŠãæã£ãŠããããã®äžã®äžã€ãã¹ã¿ã€ã«èšå®ã§ããããã¯éçºè ã«æè»æ§ãšèªç±åºŠãæäŸãã奜ã¿ããããžã§ã¯ãã®èŠä»¶ã«åºã¥ããŠã¹ã¿ã€ã«èšå®æ¹æ³ãéžæã§ããããã«ããããã§ãã
Reactã¢ããªã±ãŒã·ã§ã³ãã¹ã¿ã€ã«èšå®ããéã«ããªãCSSãã»ãšãã©ã°ããŒãã«ã§ãªãã®ã§ããïŒ
-倧èŠæš¡ãªãããžã§ã¯ãã§ã¯ãã°ããŒãã«CSSã¯ã¹ã¿ã€ã«ã®è¡çªã管çã®é£ãããªã©ã®åé¡ãåŒãèµ·ãããããCSSã¯ã»ãšãã©ã®å Žååã ã®ã³ã³ããŒãã³ãã«ã¹ã³ãŒããããã¹ãã§ããããã«ãããã³ã³ããŒãã³ãã®ã¢ãžã¥ãŒã«åãšåå©çšæ§ãåäžããã¢ããªã±ãŒã·ã§ã³ã®ä¿å®æ§ãé«ãŸããŸãã
Outlines
ãã®ã»ã¯ã·ã§ã³ã¯ææãŠãŒã¶ãŒéå®ã§ãã ã¢ã¯ã»ã¹ããã«ã¯ãã¢ããã°ã¬ãŒãããé¡ãããŸãã
ä»ããã¢ããã°ã¬ãŒãMindmap
ãã®ã»ã¯ã·ã§ã³ã¯ææãŠãŒã¶ãŒéå®ã§ãã ã¢ã¯ã»ã¹ããã«ã¯ãã¢ããã°ã¬ãŒãããé¡ãããŸãã
ä»ããã¢ããã°ã¬ãŒãKeywords
ãã®ã»ã¯ã·ã§ã³ã¯ææãŠãŒã¶ãŒéå®ã§ãã ã¢ã¯ã»ã¹ããã«ã¯ãã¢ããã°ã¬ãŒãããé¡ãããŸãã
ä»ããã¢ããã°ã¬ãŒãHighlights
ãã®ã»ã¯ã·ã§ã³ã¯ææãŠãŒã¶ãŒéå®ã§ãã ã¢ã¯ã»ã¹ããã«ã¯ãã¢ããã°ã¬ãŒãããé¡ãããŸãã
ä»ããã¢ããã°ã¬ãŒãTranscripts
ãã®ã»ã¯ã·ã§ã³ã¯ææãŠãŒã¶ãŒéå®ã§ãã ã¢ã¯ã»ã¹ããã«ã¯ãã¢ããã°ã¬ãŒãããé¡ãããŸãã
ä»ããã¢ããã°ã¬ãŒãé¢é£åç»ãããã«è¡šç€º
5.0 / 5 (0 votes)