♊️ GemiNews 🗞️ (dev)

Demo 1: Embeddings + Recommendation Demo 2: Bella RAGa Demo 3: NewRetriever Demo 4: Assistant function calling

🗞️Thinking About CSS (with React)

🗿Semantically Similar Articles (by :title_embedding)

Thinking About CSS (with React)

2018-06-17 - Kevin Randles (from Kevin Randles on Medium)

What, like I wasn’t gonna use this GIF?CSS. You know it, you use it, you…might have a complicated relationship with it. When I first started making web apps, I looked at CSS as something of a necessary evil. I just wanted to do cool stuff with JavaScript, so I relied on frameworks — first Bootstrap, then Semantic UI — with a sprinkle of my own CSS to put things in their proper places. More recently, I’ve been building a few things aren’t well suited to to a framework, like my portfolio site, where I wanted to show off my design chops (such as they are) with something that looks a little less cookie cutter. In the process, I’ve actually come to (mostly) enjoy writing CSS, but I’m also beginning to find a need to change how I work with it.To date, I’ve just been working with a single, monolithic .css file containing all of my selectors for a project…and that works. But my portfolio site is a responsive React single page application, with a little animation, and my App.css file is over 500 lines already — still manageable, but beginning to become unwieldy and hard to navigate. Time to find a new approach.In this article, I’m going to briefly look at a few of the options available to write CSS, with an eye towards solutions that play well with React’s component based approach to building pages. I don’t expect to come to any conclusions about what’s best, I’d just like to be able to make a more informed decision quickly the next time I start a project.CSS ModulesIf you’re using a Webpack-based build process, like create-react-app provides, you can import stylesheets into your .js/.jsx file that, through the magic of Webpack, will be collected into a single .css file at build time. In terms of keeping your CSS organized, having a stylesheet dedicated to a single component is far neater, and more sensible, than searching through a wall of text for the selectors that apply to that component, but as the create-react-app docs note, this is a Webpack-specific syntax, and could be cause for concern if if you change your build process somewhere down the line.styled-componentsThis is an interesting approach, if one that seems oriented more towards building a library of reusable components than the project-specific way of doing things that I’ve been using so far. With styled-components (install via NPM or your favorite package manager), you’re defining a component as a combination of an HTML element and the styles that apply to it, contained within a tagged template literal. Since this approach makes use of template literals, variables can be passed into the component, allowing styles to be defined via props. There’s a lot to like here, and while it’s not appropriate for every situation, I’m definitely considering using styled-components in the next big project that’s been bouncing around in my head recently.

[Technology] 🌎 https://medium.com/@krandles/thinking-about-css-with-react-b444e2ab91f6?source=rss-d451d084d34a------2 [🧠] [v2] article_embedding_description: {:llm_project_id=>"Unavailable", :llm_dimensions=>nil, :article_size=>3588, :llm_embeddings_model_name=>"textembedding-gecko"}
[🧠] [v1/3] title_embedding_description: {:ricc_notes=>"[embed-v3] Fixed on 9oct24. Only seems incompatible at first glance with embed v1.", :llm_project_id=>"unavailable possibly not using Vertex", :llm_dimensions=>nil, :article_size=>3588, :poly_field=>"title", :llm_embeddings_model_name=>"textembedding-gecko"}
[🧠] [v1/3] summary_embedding_description:
[🧠] As per bug https://github.com/palladius/gemini-news-crawler/issues/4 we can state this article belongs to titile/summary version: v3 (very few articles updated on 9oct24)

🗿article.to_s

------------------------------
Title: Thinking About CSS (with React)
[content]
What, like I wasn’t gonna use this GIF?CSS. You know it, you use it, you…might have a complicated relationship with it. When I first started making web apps, I looked at CSS as something of a necessary evil. I just wanted to do cool stuff with JavaScript, so I relied on frameworks — first Bootstrap, then Semantic UI — with a sprinkle of my own CSS to put things in their proper places. More recently, I’ve been building a few things aren’t well suited to to a framework, like my portfolio site, where I wanted to show off my design chops (such as they are) with something that looks a little less cookie cutter. In the process, I’ve actually come to (mostly) enjoy writing CSS, but I’m also beginning to find a need to change how I work with it.To date, I’ve just been working with a single, monolithic .css file containing all of my selectors for a project…and that works. But my portfolio site is a responsive React single page application, with a little animation, and my App.css file is over 500 lines already — still manageable, but beginning to become unwieldy and hard to navigate. Time to find a new approach.In this article, I’m going to briefly look at a few of the options available to write CSS, with an eye towards solutions that play well with React’s component based approach to building pages. I don’t expect to come to any conclusions about what’s best, I’d just like to be able to make a more informed decision quickly the next time I start a project.CSS ModulesIf you’re using a Webpack-based build process, like create-react-app provides, you can import stylesheets into your .js/.jsx file that, through the magic of Webpack, will be collected into a single .css file at build time. In terms of keeping your CSS organized, having a stylesheet dedicated to a single component is far neater, and more sensible, than searching through a wall of text for the selectors that apply to that component, but as the create-react-app docs note, this is a Webpack-specific syntax, and could be cause for concern if if you change your build process somewhere down the line.styled-componentsThis is an interesting approach, if one that seems oriented more towards building a library of reusable components than the project-specific way of doing things that I’ve been using so far. With styled-components (install via NPM or your favorite package manager), you’re defining a component as a combination of an HTML element and the styles that apply to it, contained within a tagged template literal. Since this approach makes use of template literals, variables can be passed into the component, allowing styles to be defined via props. There’s a lot to like here, and while it’s not appropriate for every situation, I’m definitely considering using styled-components in the next big project that’s been bouncing around in my head recently.
[/content]

Author: Kevin Randles
PublishedDate: 2018-06-17
Category: Technology
NewsPaper: Kevin Randles on Medium
Tags: react, css
{"id"=>4223,
"title"=>"Thinking About CSS (with React)",
"summary"=>nil,
"content"=>"
\"\"
What, like I wasn’t gonna use this GIF?

CSS. You know it, you use it, you…might have a complicated relationship with it. When I first started making web apps, I looked at CSS as something of a necessary evil. I just wanted to do cool stuff with JavaScript, so I relied on frameworks — first Bootstrap, then Semantic UI — with a sprinkle of my own CSS to put things in their proper places. More recently, I’ve been building a few things aren’t well suited to to a framework, like my portfolio site, where I wanted to show off my design chops (such as they are) with something that looks a little less cookie cutter. In the process, I’ve actually come to (mostly) enjoy writing CSS, but I’m also beginning to find a need to change how I work with it.

To date, I’ve just been working with a single, monolithic .css file containing all of my selectors for a project…and that works. But my portfolio site is a responsive React single page application, with a little animation, and my App.css file is over 500 lines already — still manageable, but beginning to become unwieldy and hard to navigate. Time to find a new approach.

In this article, I’m going to briefly look at a few of the options available to write CSS, with an eye towards solutions that play well with React’s component based approach to building pages. I don’t expect to come to any conclusions about what’s best, I’d just like to be able to make a more informed decision quickly the next time I start a project.

CSS Modules

\"\"

If you’re using a Webpack-based build process, like create-react-app provides, you can import stylesheets into your .js/.jsx file that, through the magic of Webpack, will be collected into a single .css file at build time. In terms of keeping your CSS organized, having a stylesheet dedicated to a single component is far neater, and more sensible, than searching through a wall of text for the selectors that apply to that component, but as the create-react-app docs note, this is a Webpack-specific syntax, and could be cause for concern if if you change your build process somewhere down the line.

styled-components

\"\"

This is an interesting approach, if one that seems oriented more towards building a library of reusable components than the project-specific way of doing things that I’ve been using so far. With styled-components (install via NPM or your favorite package manager), you’re defining a component as a combination of an HTML element and the styles that apply to it, contained within a tagged template literal. Since this approach makes use of template literals, variables can be passed into the component, allowing styles to be defined via props. There’s a lot to like here, and while it’s not appropriate for every situation, I’m definitely considering using styled-components in the next big project that’s been bouncing around in my head recently.

\"\"",
"author"=>"Kevin Randles",
"link"=>"https://medium.com/@krandles/thinking-about-css-with-react-b444e2ab91f6?source=rss-d451d084d34a------2",
"published_date"=>Sun, 17 Jun 2018 02:22:15.000000000 UTC +00:00,
"image_url"=>nil,
"feed_url"=>"https://medium.com/@krandles/thinking-about-css-with-react-b444e2ab91f6?source=rss-d451d084d34a------2",
"language"=>nil,
"active"=>true,
"ricc_source"=>"feedjira::v1",
"created_at"=>Mon, 01 Apr 2024 20:13:30.717595000 UTC +00:00,
"updated_at"=>Mon, 21 Oct 2024 18:02:56.233614000 UTC +00:00,
"newspaper"=>"Kevin Randles on Medium",
"macro_region"=>"Technology"}
Edit this article
Back to articles