Building a Settings Component

Category Image 052

This is a tremendous CSS-focused tutorial from Adam Argyle. I really like the “just for gap” concept here. Grid is extremely powerful, but you don’t have to use all its abilities every time you reach for it. Here, Adam reaches for it for very light reasons like using it as an in-between border alternative as well as more generic spacing. I guess he’s putting money where his mouth is in terms of gap superseding margin!

I also really like calling out Una Kravet’s awesome name for flexible grids: RAM. Perhaps you’ve seen the flexible-number-of-columns trick with CSS grid? The bonus trick here (which I first saw from Evan Minto) is to use min(). That way, not only are large layouts covered, but even the very smallest layouts have no hard-coded minimum (like if 100% is smaller than 10ch here):

.el {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10ch, 100%), 35ch));
}

There is a ton more trickery in the blog post. The “color pops” with :focus-within is fun and clever. So much practical CSS in building something so practical! 🧡 more blog posts like this, please. Fortunately, we don’t have to wait, as Adam has other component-focused posts like this one on Tabs and this one on Sidenav.

Direct Link to ArticlePermalink


The post Building a Settings Component appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

A simple encryption scheme

558fe5180e0e8fc922d31c23ef84d240

Basically this scheme uses variable offsets, but it generates the bytes on the fly. They aren't truly random, but there aren't any obvious patterns and the output passes all the NIST tests.

Since a simple password can be used to do the de/encryption it is much easier to hand off to the recipient and any good password generator can create one.

Since only part of the generated sub keys are used, it becomes very difficult if not impossible to reverse engineer the sub key to find the previous or next sub key.

Top 10 APIs for Demographics

Featured Imgs 23

Demographics is analytical data about human population statistics, which can include age, gender, education, income, locale, nationality, religion, and ethnicity.

Output a shape that is a mirror image of itself , BUT, only 3 loops allowed

558fe5180e0e8fc922d31c23ef84d240

So we can't just do the top half of the shape, then do another bunch of loops as the opposite to output the second half of the shape. This is what i did, but i'm told it can be done in no more than 3 loops. I can't quite figure out how though and i'm intrigued!

This is how it should look:

  *********
    *******
      *****
        ***
          *
        ***
      *****
    *******
   *********



    void draw3c()
{
    for (int i = 0; i <= 4; i++ )
    {
        for (int j = 0; j < i; j++)
            cout << " ";
        for (int s = 0; s < 9 - (i * 2); s++)
            cout << "*";
        for (int j = 0; j < i; j++)
            cout << " ";
        cout << "\n";
    }
    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 3 - i; j++)
            cout << " ";
        for (int s = 0; s < 3 + (i * 2); s++)
            cout << "*";
        for (int j = 0; j < 3 - i; j++)
            cout << " ";
        cout << "\n";
    }
    }

the code please

558fe5180e0e8fc922d31c23ef84d240

Mr.Sadik and Ramadan are competing together, both of them wants to become expert on Codeforces first.

You will be given two numbers R1 and R2, where R1 is the current rate of Mr.Sadik and R2 is the current rate of Ramadan.

Can you determine who will become expert first after adding X1 to Mr.Sadik rate and adding X2 to Ramadan rate.

Note that the rate must reach 1600 to become an expert.

Input
You will be given two lines. The first line will be current rates R1 and R2 where (0R1,R2106).

The second line will be additonal rates X1 and X2 where (0X1,X2106).

Output
Print Mr.Sadik if he became expert first otherwise print Ramadan.

If they both became expert print the one who has higher rate.

If none of them became expert print None.

I would like to know if someone can help me with this !

558fe5180e0e8fc922d31c23ef84d240

I would like a help from someone who knows how to ...

I want a PHP Search that does sarch for a specific keyword or something inside a directory with full of .txt files and gives the output of all Searched files with matched words with a Link where you can vist ! if someone has the time and willing to help me thank you very much in regards :)

What Autocomplete Can Do For Your Productivity

Featured Imgs 08

Back in the days when I was a junior dev, I used to marvel at my supervising senior dev’s ability to create code at insanely break-neck speed.

Within moments, he’d have a working piece of code with prototyped data almost ready and in a semi-working state. There were a lot of tabs pressed, his fingers never leaving the keyboard to touch the mouse for the duration of his demonstration.

Plugins to Customize WooCommerce Product Pages

Set Up Woocommerce

How to Customize WooCommerce Product PagesWooCommerce is one of the most popular e-commerce platforms, accounting for almost a third of all online stores. However, while this platform is undoubtedly intuitive, it’s fair to say that its popularity is driven by the sheer amount of plugins that help customize the platform to better meet store owners’ needs. One of the specific […]

The post Plugins to Customize WooCommerce Product Pages appeared first on WPExplorer.

CSS Is, In Fact, Awesome

Featured Imgs 23

You’ve seen the iconic image. Perhaps some of what makes that image so iconic is that people see what they want to see in it. If you see it as a critique of CSS being silly, weird, or confusing, you can see that in the image. If you see it as CSS being powerful and flexible, you’ve got that too. That’s what Jim Neilsen is saying here, reacting to a presentation by Hidde de Vries:

This is the power of CSS. It gives you options. Use them or don’t.

Want it to overflow visibly? It can. Want it to lop off overflowing content? It can. Want it to stretch? It can. Want it to ellipse? It can. Want it to wrap or not wrap? It can. Want to scale the type to fit? It can. If you love CSS, this is probably exactly why.

Mandy Michael has a great thread on this from a few years back:

Brandon Smith wrote about all this a few years back as well. I remain chuffed that Eric Meyer asked the original creator of the image, Steve Frank of Panic, about it and Steve once stopped by to explain the real origin:

It was 2009 and I’d spent what seemed like hours trying to do something in CSS that I already knew I could do in seconds with tables. I was trying really hard to do it with CSS because that’s what you’re supposed to do, but I just wasn’t very good at it (spoiler alert: I’m still not very good at it).

I do have a slightly better grasp on the concept of overflow now, but at the time it just blew my mind that someone thought the default behavior should be to just have the text honk right out of the box, instead of just making the box bigger like my nice, sensible tables had always done.

Anyway, I just had this moment of pure frustration and, instead of solving the problem properly, I spent 5 minutes creating a snarky mug and went back to using tables. Because that’s my signature move in times of crisis.

So, the original is indeed born out of frustration, but has nonetheless inspired many love letters to CSS. It has also certainly earned its place in CSS infamy, right alongside Peter Griffin struggling with window blinds, as one of the most iconic CSS images ever.

Direct Link to ArticlePermalink


The post CSS Is, In Fact, Awesome appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.