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