Categories
Programming

CSS Clamp: The Goldilocks of CSS Math Functions

There is a problem I have wrestled with a couple of times, which was frustrating to solve… but can now be easily solved using clamp, which is currently in an Editors Draft of the CSS Values and Units Module Level 4 specification. It is sat alongside similar mathmatical CSS nuggets, such as min and max […]

Categories
Programming

Fixing CSS object-fit for Internet Explorer

A common problem with images, especially if they are user-generated, is that they don’t have the correct aspect ratio for their intended purpose. Also, as we re-flow pages for many different devices, we often want the image to work with different aspect ratios. This is where the CSS object-fit property comes in very useful. There […]

Categories
Programming

Minification Failed. Returning Unminified Contents.

Has you ASP.NET applicaiton reported that minification failed? If you are using bundles in application, you might come across this exception comment at the top of your larger-than-expected bundle file. /* Minification failed. Returning unminified contents. (List of problems here) */ It can happen for JavaScript or CSS, but it means minifier has found something […]

Categories
Programming

The CSS Sibling Selector

There is often a bit of confusion surrounding the CSS sibling selector, or ~ as it is known to its friends. Here is how it works. This CSS translated into English says: If there are is a paragraph next to another paragraph inside a division, make the text red Here is an example HTML snippet […]

Categories
Programming

Get Elements Grouped By a CSS Value

The following script allows you to group all elements on a web page by a particular CSS value. So for example, if you specify ‘fontFamily’, you’ll get a list of font families used on the website, and a list of all elements using each one. You can specify other attributes if you would like to […]

Categories
Programming

Generate Multiple Themes From the Same LESS File

So you have a CSS theme written using LESS. A simple example would be like the example below… you’ve extracted your variables into a file named “variables.less” and you use an import to make those variables available to your main stylesheet. If you decide to change something important, you can do that in the variables […]

Categories
Programming

HTML and CSS Full Screen Layout Without Fuss

This is a quick guide to the modern method of getting a 100% high chunk of content without a lot of fuss. This technique also works for creating a 100% chunk of content, with more content being appended after the fold. We’ll use this dummy HTML for the purposes of the example – it works […]

Categories
Programming

Make The RESTClient Body Input Bigger

RESTClient is a useful Firefox extension for sending HTTP REST messages to a service. As well as a useful and simple interface for sending requests, it also lets you store requests to re-use again later. If you are writing REST services, it is a useful tool to have lying around. The only problem I have […]

Categories
Programming

Generating PDF Files From Web Pages With Paged Media

Having recently starting adding CSS Paged Media to web pages, and generating dynamic headers from page content – I had a need to push the results of this to PDF. The use-case was two-fold, one was to generate a whole batch of PDFs to “print later” and the other was for sending the content for […]

Categories
Programming

Website Go Faster Stripes

My early spring-clean has been going on for a while. I have been gradually deleting things to make the site go faster. As usual, if you don’t keep a close watch on things they start to bloat. My site had reached a whopping 400kb for an empty-cache first-load and spanned far too many network requests […]