My personal site cherry.computer
htmx tailwind axum askama

feat: switch to modern-normalize CSS package

The normalize.css package hasn't been updated in 7 years and I suspect
many of its changes are no longer necessary. modern-normalize is
slightly more opinionated, and resulted in some layout shifts due to it
defaulting to `box-sizing: border-box;`. But that's meant I've now gone
back and improved my CSS to rely less on padding when margins are more
appropriate, and made more use of flexbox to centre elements rather than
auto margins.

cherry.computer 9dbbd063 aa6ca680

verified
+31 -26
+18 -11
frontend/package-lock.json
··· 11 "dependencies": { 12 "htmx-ext-sse": "^2.2.2", 13 "htmx.org": "^2.0.4", 14 - "normalize.css": "^8.0.1", 15 "three": "^0.172.0" 16 }, 17 "devDependencies": { ··· 1954 "url": "https://github.com/sponsors/ljharb" 1955 } 1956 }, 1957 "node_modules/ms": { 1958 "version": "2.1.3", 1959 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", ··· 1973 "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", 1974 "dev": true, 1975 "license": "MIT" 1976 - }, 1977 - "node_modules/normalize.css": { 1978 - "version": "8.0.1", 1979 - "resolved": "https://registry.npmjs.org/normalize.css/-/normalize.css-8.0.1.tgz", 1980 - "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==" 1981 }, 1982 "node_modules/optionator": { 1983 "version": "0.9.4", ··· 3577 "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 3578 "dev": true 3579 }, 3580 "ms": { 3581 "version": "2.1.3", 3582 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", ··· 3594 "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", 3595 "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", 3596 "dev": true 3597 - }, 3598 - "normalize.css": { 3599 - "version": "8.0.1", 3600 - "resolved": "https://registry.npmjs.org/normalize.css/-/normalize.css-8.0.1.tgz", 3601 - "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==" 3602 }, 3603 "optionator": { 3604 "version": "0.9.4",
··· 11 "dependencies": { 12 "htmx-ext-sse": "^2.2.2", 13 "htmx.org": "^2.0.4", 14 + "modern-normalize": "^3.0.1", 15 "three": "^0.172.0" 16 }, 17 "devDependencies": { ··· 1954 "url": "https://github.com/sponsors/ljharb" 1955 } 1956 }, 1957 + "node_modules/modern-normalize": { 1958 + "version": "3.0.1", 1959 + "resolved": "https://registry.npmjs.org/modern-normalize/-/modern-normalize-3.0.1.tgz", 1960 + "integrity": "sha512-VqlMdYi59Uch6fnUPxnpijWUQe+TW6zeWCvyr6Mb7JibheHzSuAAoJi2c71ZwIaWKpECpGpYHoaaBp6rBRr+/g==", 1961 + "license": "MIT", 1962 + "engines": { 1963 + "node": ">=6" 1964 + }, 1965 + "funding": { 1966 + "url": "https://github.com/sponsors/sindresorhus" 1967 + } 1968 + }, 1969 "node_modules/ms": { 1970 "version": "2.1.3", 1971 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", ··· 1985 "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", 1986 "dev": true, 1987 "license": "MIT" 1988 }, 1989 "node_modules/optionator": { 1990 "version": "0.9.4", ··· 3584 "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 3585 "dev": true 3586 }, 3587 + "modern-normalize": { 3588 + "version": "3.0.1", 3589 + "resolved": "https://registry.npmjs.org/modern-normalize/-/modern-normalize-3.0.1.tgz", 3590 + "integrity": "sha512-VqlMdYi59Uch6fnUPxnpijWUQe+TW6zeWCvyr6Mb7JibheHzSuAAoJi2c71ZwIaWKpECpGpYHoaaBp6rBRr+/g==" 3591 + }, 3592 "ms": { 3593 "version": "2.1.3", 3594 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", ··· 3606 "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", 3607 "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", 3608 "dev": true 3609 }, 3610 "optionator": { 3611 "version": "0.9.4",
+2 -2
frontend/package.json
··· 35 "url": "https://github.com/ivomurrell/myivo.git" 36 }, 37 "dependencies": { 38 - "htmx.org": "^2.0.4", 39 "htmx-ext-sse": "^2.2.2", 40 - "normalize.css": "^8.0.1", 41 "three": "^0.172.0" 42 }, 43 "volta": {
··· 35 "url": "https://github.com/ivomurrell/myivo.git" 36 }, 37 "dependencies": { 38 "htmx-ext-sse": "^2.2.2", 39 + "htmx.org": "^2.0.4", 40 + "modern-normalize": "^3.0.1", 41 "three": "^0.172.0" 42 }, 43 "volta": {
-4
frontend/src/css/defaults.css
··· 1 - html { 2 - font-family: -apple-system, Helvetica, Arial, sans-serif; 3 - } 4 - 5 h1 { 6 font-size: 3.6em; 7 padding-left: 4%;
··· 1 h1 { 2 font-size: 3.6em; 3 padding-left: 4%;
+1 -2
frontend/src/css/header.css
··· 29 --logo-aspect-ratio: 2.5; 30 31 height: 100%; 32 - margin: auto; 33 - padding-right: 3%; 34 width: calc(var(--header-viewport-proportion) * var(--logo-aspect-ratio)); 35 36 @media screen and (max-height: 500px) {
··· 29 --logo-aspect-ratio: 2.5; 30 31 height: 100%; 32 + margin-right: 3%; 33 width: calc(var(--header-viewport-proportion) * var(--logo-aspect-ratio)); 34 35 @media screen and (max-height: 500px) {
+1 -1
frontend/src/css/main.css
··· 1 - @import "normalize.css"; 2 @import "defaults"; 3 @import "header"; 4 @import "projects";
··· 1 + @import "modern-normalize"; 2 @import "defaults"; 3 @import "header"; 4 @import "projects";
+9 -6
frontend/src/css/projects.css
··· 1 .projects { 2 - --animation-padding: calc(100% / 12); 3 } 4 5 @keyframes project-fade-in-left { 6 0% { 7 opacity: 0; 8 - transform: translateX(calc(var(--animation-padding) * -1)); 9 } 10 11 100% { ··· 17 @keyframes project-fade-in-right { 18 0% { 19 opacity: 0; 20 - transform: translateX(var(--animation-padding)); 21 } 22 23 100% { ··· 29 .project-container { 30 align-items: center; 31 display: flex; 32 - margin: 0 auto 6vh; 33 max-width: 1000px; 34 - padding: 0 var(--animation-padding); 35 36 @media screen and (max-width: 900px) { 37 flex-wrap: wrap-reverse; ··· 43 44 .project-container:nth-child(odd) { 45 --animation: project-fade-in-right; 46 - --flex-direction: reverse; 47 48 .project-desc { 49 margin-right: var(--margin);
··· 1 .projects { 2 + --animation-distance: calc(100% / 12); 3 + 4 + display: flex; 5 + flex-direction: column; 6 + align-items: center; 7 } 8 9 @keyframes project-fade-in-left { 10 0% { 11 opacity: 0; 12 + transform: translateX(calc(var(--animation-distance) * -1)); 13 } 14 15 100% { ··· 21 @keyframes project-fade-in-right { 22 0% { 23 opacity: 0; 24 + transform: translateX(var(--animation-distance)); 25 } 26 27 100% { ··· 33 .project-container { 34 align-items: center; 35 display: flex; 36 + margin: 0 var(--animation-distance) 6vh; 37 max-width: 1000px; 38 39 @media screen and (max-width: 900px) { 40 flex-wrap: wrap-reverse; ··· 46 47 .project-container:nth-child(odd) { 48 --animation: project-fade-in-right; 49 + --flex-direction: row; 50 51 .project-desc { 52 margin-right: var(--margin);