• author: Kevin Powell

Taking on Coding Challenges: An Introduction to ICodeThis.com

Are you looking for a way to challenge and improve your front-end development skills? Look no further than ICodeThis.com, a site that offers daily coding challenges and projects designed to take 20-40 minutes to complete. Whether you're looking to enhance your HTML, CSS, or JavaScript skills, these bite-sized challenges are a great way to practice and build your portfolio.

Getting Started

To begin, simply head to ICodeThis.com and select a challenge of your choice. Once you click "Start Challenge", you'll be taken to a fully functional IDE where you can begin coding and previewing your progress in real-time. Keep in mind that these challenges are designed to be smaller UI components, such as contact cards or buttons, rather than complete websites.

One of the great features of ICodeThis.com is that you'll be working with static images rather than Figma files, allowing you more creative control over the finished product. Additionally, you can view and learn from other users' solutions to the same challenge once you've submitted your own.

The Challenge

Let's take a closer look at one such challenge from ICodeThis.com, a contact card:

<mainclass="card"><h1>Hi George</h1><div><p>You can contact us whenever you need help or just curious</p><h2>Start Chatting</h2><divclass="status"data-status="octave">Active</div><buttonclass="button">Send a Message</button></div><imgsrc="https://i.pravatar.cc/300"/><p>Essie Walton</p></main>

This challenge involves creating a contact card that will maintain consistent spacing regardless of the length of the content. The finished product should include an image, a name, a status indicator, and a button to send a message.

An Experiment with Subgrid

In the video, the author decides to use subgrid to experiment with a new technique. While not necessary for this challenge, this is a great example of how ICodeThis.com can be used to test and improve your skills.

Using Subgrid in CSS Layouts

Grid and subgrid are powerful tools in CSS layouts. Subgrid allows for even more precision and control over layouts, especially when dealing with nested grids. In this article, we'll explore using subgrid to create a card layout with overlapping sections.

To start, we'll set the overall layout with a minimum height of 100vh and center the content using place-content: center. Then, we'll define a grid template with one row for our overlapping sections and one row for the bottom part of the card.

We'll use the class .card for the grid container and set display: grid. This will allow us to use grid template columns and rows to create the desired layout.

Next, we'll define the two sections with colors: a light blue background for the welcome section and coral for the start chatting section. We'll also specify the grid columns for each section: the welcome section will cover the first grid column, while the start chatting section will cover the second and third grid columns.

Now, we'll use subgrid to create the overlapping section. By nesting a div inside the welcome section and setting display: grid and grid-template-rows: subgrid, we can place the content of the overlapping section on the parent grid. This gives us more control over the layout, especially as the content grows.

We can also use custom properties to set the colors for the layout, making it easier to maintain and update. In addition, we can use gradients to give the layout a more dynamic look.

It's important to note that subgrid is not widely supported by all browsers, so it's important to use fallbacks and test in multiple browsers. However, with its power and flexibility, subgrid is a tool worth exploring and utilizing in CSS layouts.

Styling the Page

After some initial adjustments to center the content and set the font family, the author begins to style individual elements of the page. They use variables to set colors and create a gradient background for the "Welcome" section. The author also adds a border radius to the "Start Chatting" section to give it a circular appearance.

Applying Margins and Spacing

The author realizes that they need to reset the margin to zero for some elements and applies a margin to the "Rep Info" section to add some spacing. They also experiment with using grid and flexbox to adjust the layout and spacing.

Naming Conventions

The author briefly discusses the importance of using good naming conventions but notes that for this simple project, they can get away with using classes like "start chatting" to identify specific elements.

Challenges and Problem Solving

Throughout the styling process, the author encounters several challenges, such as a gradient not working as expected and the need to adjust the padding for different sections. To solve these issues, they use Dev tools to examine the page and try different settings until they achieve the desired effect.

Overall, the author provides a detailed account of how they style the page, discussing their thought process and the tools they use to achieve their goals.

The Downsides of Using Flexbox Grid for Spacing

Flexbox grids are a popular way of creating responsive layouts that adjust to various screen sizes. One of the advantages of using a flexbox grid is that it makes it easy to add spacing between elements. However, there are some downsides to using a flexbox grid for spacing.

Overcoming Spacing Challenges

When adding spacing between elements using a flexbox grid, it can be challenging to get the spacing just right. The author of the text above discusses the challenge of determining the appropriate spacing, noting that they use a gap of two RAM and then adjust the padding to achieve the desired spacing. Additionally, the author adds that the downside of using a grid for spacing is that elements can appear too close together if a gap of zero is used.

Considerations for Nesting Grids

The author also discusses the challenge of nesting grids when using a flexbox grid for spacing. They note that it can be challenging to get the spacing just right between nested cards and headers. To overcome this challenge, the author suggests using inheritance to apply CSS styles consistently throughout the nested elements.

Accessibility Considerations

When using visual indicators like the green dot mentioned in the text above, it's essential to consider accessibility. While the green dot may not convey any new information, it can help users who may have difficulty reading or identifying text elements. However, it's important to ensure that the visual indicator meets accessibility standards, such as contrast ratios.

Styling Buttons and Statuses with Data Attributes and CSS

In this article, we'll explore how to style buttons and status indicators using CSS and data attributes. We'll specifically look at creating a circular status indicator with a custom color, and then style a generic button with a hover effect.

Creating a Circular Status Indicator

To create a circular status indicator with a custom color, we need to use a data attribute selector to change the color dynamically. Here are the steps we'll take:

  1. Set the background-color of the status indicator to a default color.
  2. Use a data attribute selector data-status to change the color when the status changes.
  3. Apply a border-radius of 50% to ensure the indicator is circular.

Here's the CSS for the circular status indicator:

.status {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: var(--status-color, limegreen);
  border-radius: 50%;
}

.status[data-status="active"] {
  background-color: var(--status-color, limegreen);
}

.status[data-status="away"] {
  background-color: var(--status-color, orange);
}

We can easily update the data-status attribute with JavaScript to change the color dynamically. When using data attributes for styling, we don't have to worry about toggling classes, which can lead to conflicting styles when multiple classes are applied.

Styling a Generic Button

To style a generic button with a hover effect, we'll set the default style using custom properties and apply the hover effect using a CSS transition.

Here's the CSS for the generic button:

button {
  background-color: var(--btn-bg-color, var(--variant));
  color: var(--btn-color, var(--neutral-100));
  border: 0;
  border-radius: 0.25rem;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-size 200ms, transform 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

button:hover, button:focus {
  background-size: 200%;
  transform: scale(1.05);
  box-shadow: 0px 4px 11px 4px rgba(0,0,0,0.1);
}

We use custom properties to set the default background-color, color, and font-size of the button. We also apply a border-radius of 0.25rem to give the button a slightly rounded corner. To create the hover effect, we use a CSS transition to animate the background-size, transform, and box-shadow properties.

Using Daily CSS Images Challenges for Design Inspiration

If you are ever in need of design inspiration, you might want to consider taking part in the Daily CSS Images Challenges. This project is a great way for designers of all levels to learn new techniques, experiment with different styles, and build up a library of designs to use in future projects.

What are the Daily CSS Images Challenges?

The Daily CSS Images Challenges are a series of daily design challenges that are posted on the website dailycssimages.com. Each challenge consists of a single image that must be recreated using only HTML and CSS.

How do the Daily CSS Images Challenges work?

To take part in the Daily CSS Images Challenges, simply visit the website and click on the current day's challenge. You can then use your HTML and CSS skills to recreate the image. Once you are happy with your design, you can submit it to the website.

What happens after you submit your design?

After you submit your design, you can view other people's designs and see how they approached the same challenge. You can also access all their code, which is a great way to learn new techniques and improve your own coding skills.

Are there any additional benefits to participating in the Daily CSS Images Challenges?

Yes! Here are some additional benefits:

  • The challenges are a fun way to practice your HTML and CSS skills.
  • You can build up a library of designs to use in future projects.
  • You can experiment with different styles and techniques.
  • You can learn new skills by viewing other people's designs and code.
  • You can use the challenges for creating content for your own projects and channels.

How can you access the pro version of the Daily CSS Images Challenges?

If you want access to the pro version of the Daily CSS Images Challenges, you can use the coupon code "Kevin" to get 10% off. The pro version offers additional challenges and benefits.

Are there any other purchasing options?

Yes! There is also a lifetime purchase option called the PPP coupon. This option offers even more benefits and is a great choice for designers who want to continue using the Daily CSS Images Challenges in the future.

InIcodethis.com offers a fun and accessible way to challenge and enhance your front-end development skills. whether you're a beginner or an experienced developer, these daily coding challenges can help you build your portfolio and stay up-to-date with the latest techniques and trends. so what are you waiting for? head to icodethis.com and start coding!
While using a flexbox grid for spacing can help create responsive layouts, it's not without its challenges. designers must consider the appropriate spacing, nesting grids, and accessibility when using visual indicators. by keeping these considerations in mind, designers can ensure that their designs are both responsive and accessible to all users.
Using data attributes for styling can make it easier to dynamically update styles without worrying about conflicting classes. we can also use custom properties and css transitions to create generic, reusable styles for buttons and other elements. by combining these techniques, we can create polished and flexible user interfaces with minimal css code.
, the Daily CSS Images Challenges are a fun and useful tool for designers of all levels. Whether you want to learn new skills, experiment with different styles, or build up a library of designs, the challenges offer a great way to do it.

Previous Post

Why I Stick With Vanilla HTML, CSS, and JavaScript

Next Post

Exploring the State of CSS 2023 Survey

About The auther

New Posts

Popular Post