diff --git a/package-lock.json b/package-lock.json index a819ce51..63073ae0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.15.0", + "version": "5.16.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9691bc26..3b9b020c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.15.0", + "version": "5.16.0", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/css/button.css b/src/css/button.css index cff42f48..79a45399 100755 --- a/src/css/button.css +++ b/src/css/button.css @@ -191,6 +191,19 @@ button [class*=" button-"]:last-child, margin-right: 0; } +.button-ring { + transition: background-color var(--layout-timing-extra-fast), border-color var(--layout-timing-extra-fast), color var(--layout-timing-extra-fast), box-shadow var(--layout-timing-extra-fast); +} + +.button-ring:hover { + box-shadow: var(--form-ring-hover); +} + +.button-ring:focus, +.button-ring:active { + box-shadow: var(--form-ring-accent); +} + .button-link { background-color: transparent; border: 0; diff --git a/src/css/theme.css b/src/css/theme.css index f1c15fc7..628b5ded 100644 --- a/src/css/theme.css +++ b/src/css/theme.css @@ -2,25 +2,22 @@ .theme-custom-item { width: var(--theme-preview-size); height: var(--theme-preview-size); - border-radius: var(--theme-radius); position: relative; - overflow: hidden; } .theme-preset-button, .theme-custom-button { padding: 0; - border-radius: 0; - width: var(--theme-preview-size); - height: var(--theme-preview-size); + border-radius: var(--theme-radius); + width: 100%; + height: 100%; line-height: 1.6; position: absolute; top: 0; left: 0; display: block; - overflow: hidden; z-index: 2; - transition: height var(--layout-timing-extra-fast), box-shadow var(--layout-timing-extra-fast); + transition: height var(--layout-timing-extra-fast), box-shadow var(--layout-timing-extra-fast), border-radius var(--layout-timing-extra-fast); } .theme-preset-button:after, @@ -29,10 +26,12 @@ } .theme-custom-control { - width: var(--theme-preview-size); + border-radius: 0 0 var(--theme-radius) var(--theme-radius); + width: 100%; height: 0; position: absolute; bottom: 0; + overflow: hidden; display: flex; justify-content: flex-start; align-items: stretch; @@ -51,21 +50,38 @@ } .is-theme-custom-edit .theme-custom-button { - height: calc(var(--theme-preview-size) - var(--theme-custom-edit-height)); + border-radius: var(--theme-radius) var(--theme-radius) 0 0; + height: calc(100% - var(--theme-custom-edit-height)); box-shadow: var(--theme-shadow-bottom-medium); } +.is-theme-custom-edit .theme-custom-button:hover { + box-shadow: var(--form-ring-hover); +} + +.is-theme-custom-edit .theme-custom-button:focus, +.is-theme-custom-edit .theme-custom-button:active { + box-shadow: var(--form-ring-accent); +} + .is-theme-custom-edit .theme-custom-control { height: var(--theme-custom-edit-height); } .theme-preset-preview, .theme-custom-preview { - width: var(--theme-preview-size); - height: var(--theme-preview-size); + border-radius: var(--theme-radius); + width: 100%; + height: 100%; position: absolute; top: 0; left: 0; + overflow: hidden; + transition: border-radius var(--layout-timing-extra-fast); +} + +.is-theme-custom-edit .theme-custom-preview { + border-radius: var(--theme-radius) var(--theme-radius) 0 0; } .theme-preset-background-01, @@ -265,27 +281,48 @@ background-color: rgb(var(--theme-color-20)); } -.theme-shadow-box { - background-color: rgb(var(--theme-color-02)); - border-radius: var(--theme-radius); - padding: 0.5em; - width: 5em; - height: 5em; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - white-space: normal; +.theme-accent-preset-grid { + display: grid; + grid-gap: var(--form-wrap-space); + grid-template-columns: repeat(7, 1fr); + grid-template-rows: repeat(5, 1fr); + justify-items: center; } -.theme-shadow-box-small { - box-shadow: var(--theme-shadow-bottom-small); +.theme-accent-preset-item { + background-color: hsl(var(--theme-accent-preset-item-color-h), calc(var(--theme-accent-preset-item-color-s) * 1%), calc(var(--theme-accent-preset-item-color-l) * 1%)); + padding: 0; + width: 1.5em; + height: 1.5em; + min-width: 1.5em; + min-height: 1.5em; + min-height: initial; } -.theme-shadow-box-medium { - box-shadow: var(--theme-shadow-bottom-medium); +.theme-accent-preset-item:focus, +.theme-accent-preset-item:hover, +.theme-accent-preset-item:active { + background-color: hsl(var(--theme-accent-preset-item-color-h), calc(var(--theme-accent-preset-item-color-s) * 1%), calc(var(--theme-accent-preset-item-color-l) * 1%)); } -.theme-shadow-box-large { - box-shadow: var(--theme-shadow-bottom-large); +.theme-accent-preset-item:after { + content: none; +} + +@media (min-width: 700px) { + .theme-accent-preset-item { + width: 2em; + height: 2em; + min-width: 2em; + min-height: 2em; + } +} + +@media (min-width: 900px) { + .theme-accent-preset-item { + width: 2.5em; + height: 2.5em; + min-width: 2.5em; + min-height: 2.5em; + } } diff --git a/src/html/menu/content/theme/accent.html b/src/html/menu/content/theme/accent.html index 1f598d46..33977422 100644 --- a/src/html/menu/content/theme/accent.html +++ b/src/html/menu/content/theme/accent.html @@ -3,6 +3,8 @@