Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "css"


Which Colors Look Good on Black and White?

  • Imagine you have to find a color that looks good both on black and white.
  • By "looking good" I mean conforming at least WCAG AA Contrast (Minimum), which is a ratio of 4.5:1.
  • NOTE Contrast ratios can range from 1 to 21 (commonly written 1:1 to 21:1).
  • Simple math, right?
  • You take two values and divide them.
  • Then getting the R, G, and B values is done by a simple division (divide by 12.92) if the normalized value is less than or equal to 0.03928, or applying the exponential formula above if the normalized value is greater than 0.03928.
  • The final step is summing the these three values with different weights.

save | comments | report | share on


Repl.it GFX: Native graphics development in the browser

  • And today, we're excited to bring native GUI applications and game development to the browser.
  • We want programmers from all backgrounds, regardless of their language, to be able to code games and apps with ease.
  • Plus, supporting native graphics opens us up to a wealth of frameworks, games, and educational material!
  • Right now, we're piping the X Window system through VNC through WebSockets to your browser, which is not the most efficient way to do this — we have a lot of ideas on how we could improve it.
  • Finally, depending on how far you are from our data center (US-central) you might feel a delay, which we're also working on making better by replicating our data center (watch out Google Stadia).
  • We're supporting these frameworks out of the box, but very soon, we'll roll this out to all of our languages.

save | comments | report | share on


Which colors look good on black and white?

  • Imagine you have to find a color that looks good both on black and white.
  • By "looking good" I mean conforming at least WCAG AA Contrast (Minimum), which is a ratio of 4.5:1.
  • NOTE Contrast ratios can range from 1 to 21 (commonly written 1:1 to 21:1).
  • Simple math, right?
  • You take two values and divide them.
  • Then getting the R, G, and B values is done by a simple division (divide by 12.92) if the normalized value is less than or equal to 0.03928, or applying the exponential formula above if the normalized value is greater than 0.03928.
  • The final step is summing the these three values with different weights.

save | comments | report | share on


#showdev CSS 3D - Scrolling on the z-axis

  • In this article, we are going to create a small 3D scene, where the user can scroll on the z-axis.
  • This method allows us to use the transform CSS property to set perspective or rotation on the z-axis to our DOM elements.
  • We already mentioned earlier that the transform CSS property allows us to set our elements in a 3D space.
  • In the following example, you can play with the Z-axis position of the .cube and .face- by changing the value of cubeTranslateZ and cubeFacesTranslateZ.
  • Now that we have a good understanding of how CSS 3D works we are going to create a 3D scene, where we are going to be able to scroll on the z-axis.
  • To be able to scroll, we need first to set the value of --viewportHeight which emulates the depth of the scene.

save | comments | report | share on


HTML Emails 101 For Web Developers

  • Email development and design is not easy, as email client suppliers have not been nearly as progressive as web browser suppliers are in implementing new standards.
  • People who buy email lists typically experience a huge number of bounces, gain a bad reputation for their IP (Internet Protocol) address, have their emails blocked by ISPs (Internet service providers) or the email gets sent to spam.
  • Specific version numbers of Outlook can be targeted, while WebKit-based clients can be targeted with a media query.
  • Various clients show pre-header text under or next to the subject line, e.g. AOL, Gmail, iOS, Outlook 2013, and Apple Mail.
  • Various clients render plain-text emails as HTML, e.g. Gmail adds default styles and converts URLs into links.
  • We can use media queries, grid-based layouts and fluid design in emails, but not every client support these.

save | comments | report | share on


HTML Emails 101 For Web Developers

  • Email development and design is not easy, as email client suppliers have not been nearly as progressive as web browser suppliers are in implementing new standards.
  • People who buy email lists typically experience a huge number of bounces, gain a bad reputation for their IP (Internet Protocol) address, have their emails blocked by ISPs (Internet service providers) or the email gets sent to spam.
  • Specific version numbers of Outlook can be targeted, while WebKit-based clients can be targeted with a media query.
  • Various clients show pre-header text under or next to the subject line, e.g. AOL, Gmail, iOS, Outlook 2013, and Apple Mail.
  • Various clients render plain-text emails as HTML, e.g. Gmail adds default styles and converts URLs into links.
  • We can use media queries, grid-based layouts and fluid design in emails, but not every client support these.

save | comments | report | share on


Things nobody ever taught me about CSS

  • These terms have more to do with how the browser renders things but it is still important as some CSS properties will impact different steps of the rendering pipeline.
  • Modifying a “layout” property in CSS (e.g: width, height) means that the browser is going to have to check all other elements and “reflow” the page, meaning repainting the affected areas and composite them back together.
  • If you change a CSS property that requires neither layout or paint, then the browser only needs to do compositing.
  • Looking at these steps, we can see that the more specific the right selector is, the more efficient it will be for the browser to filter through and resolve CSS properties.
  • If you change these properties on a lot of elements, it’s going to take a long time to calculate and update their position/dimension.

save | comments | report | share on


Windows 3.1, a walk down memory lane

  • The idea was to run an original version of Windows 3.1 on his IBM ThinkPad 390 and load up Internet Explorer 3.
  • Eventually, I decided to run my own copy of Windows 3.1 via VirtualBox so I could get access to the original Windows Entertainment Pack games.
  • Once Windows is installed and proven to be running properly, you can add in the fun stuff outlined in the tutorial, including a better graphics driver (which makes the screen bigger), and the well-loved TADA start up tune.
  • For the CD-ROM driver, I got it to work by following instructions from Chris Sprague titled Install MS-DOS 6.22 in a Virtual Machine for Fun and Profit.
  • If you install the second Windows Entertainment Pack, you also get this early version of what eventually would become the game Microsoft Mahjong, that was most likely based off the original 1981 classic, Mah-jongg by Brodie Lockhart.

save | comments | report | share on


#discuss CSS power-up: count code lines in pure CSS

  • I decided to start a series called CSS power-up!
  • The way it works is by creating a named counter and specifying which CSS class increments that counter.
  • On top of that you also have access to the counter value that you can display as content.
  • First let's define the class of the container of the code block.
  • Now we need to determine which class will be in charge of incrementing the counter.
  • We use the counter-increment property for that and give it the value of the counter name we want to increment, in our case line.
  • To finish up we also want to display the counter value.
  • Using counter(line) with the content property that's exactly what we get.
  • At first I was very thrilled by the simplicity of this method then I remembered that I had to check browser support.

save | comments | report | share on


#discuss 5 reasons to go with CSS in JS for your next application

  • I still believe that the current CSS architecture has a place in this crazy world for small sites, and even small applications.
  • I will be demonstrating how CSS in JS solves these issues by using 2 libraries Styled Components and React.
  • I created a style sheet that contains CSS code for a container element.
  • Now I have created the home page HTML, imported the stylesheet, and have added the class names to the HTML elements.
  • I’ve now created the about HTML page, imported the style sheet, and created a new container element.
  • I created a new file named constants.js, and inside that file it contains a value for the primary text color, FireBrick.
  • I than updated the Greet component to use the new constant I created.
  • While I’m at it, I’ll create a new component called Button, and it will use the same constant.

save | comments | report | share on