Files
webawesome/docs/assets/styles/search.css
Lea Verou bdd25571a8 Themer first slice (#857)
* Basic scaffolding

* Generate theme & palette data.js that other JS can import

* Make it possible to include page-card without links

* WIP

* Add `appearance` to details, closes #569

Except `accent` as that's a) far less useful and b) trickier due to the icon color

* Fix broken link

* WIP

* WIP

* Icons icon

* Unify styles for interactive cards

* Prevent focusing inside theme icons

* Fixes

* Action page cards

* Panel scrollables

* scrollable

* Scroll shadows

* Add renaming UI

* UI

* Move styling of heading icons to `ui.css`

* Support permalinks & CRUD

* Make clickable cards more accessible

* Style cards a little better

* Default to styles panel if theme is selected

* Update theme-icons.css

* Custom themes should be saved under Custom

* Get theme code

* Bigger title

* Fixes

* Use theme Vue app for remixing too

* Fix preview jank and make preview script more flexible

* Make radio groups scrollable

* Add affordance to button cards

* Sticky

* `<color-select>`

* Fix theme remixing

* Improve previewing logic

* Fix preview

* Move `domChange()` to separate module

`theme-picker.js` includes side-effects, which may not always be desirable everywhere we may want to import `domChange()`

* Update preview.js

* Panel animation

* Hide Save button if no changes and not saved

* Do not show blank code when no selection has been made

* Use theme slug in filename

* Remove unused component

* Better UI for editing title (and any other text)

* Tweak UI of renaming

* Better indicate default selection

* Fix preview reverting bug

* Fill out app preview with more examples

* Remove `zoom` from theme showcase (yields unexpected/painful results Safari), improve display in wider viewports

* Pending delete

* Make styles panel cards scrollable

* Fix some of the Safari issues

* Update search.css

* Update panel.css

* Select preview UI

* Fix typo

* Frame colors setting as color contrast

* Show dark mode in color mappings

* Brand color

* Swatch styling

* Fix caret icon

* Move Starting theme to the same level as other controls

* Rename typography to Fonts

* Fix bug: Swatch select should show swatches from the selected palette

* Move capitalize to shared utils

* Add utils for handling nested objects

* Icons panel

* Update code.js

* Move utils around

* Add fit and finish to sidebar panels

* Theme card: Move icons to separate data structure

* Move data to dedicated folder since we now have a lot more of it

* Add default icon families and variants to themes

* Data

* Add `deepEntries()`

* Add Duotone

* Spruce up icons preview

* Use theme's icon family in showcase

* Font cards

* Font cards

* Add `max-inline-size` to preview container

* Remove alternate preview options

* Remove theme subtitle

* Support FA kit codes

* Remove Pro badges from theme cards

* Use panagram preview for Fonts

* Consistent heading and label capitalization

* Classes for different icons-card types

* Update data.js.njk

* Variable style on icon family cards

* Fix Sharp Duotone

* Clean up FA kit code hint

* Hide non-functional Icon Library field

* Fix theme icon heights

* icon variant -> style in theme metadata

* Fix bug with icons defaults not being shown

* More convenient theme defaults

* Fix bug with non updating URL

* Fix bug

* Fix multiplying badges

* Custom docs pages

* Add Duotone icons to Mellow theme

* Fix 404

* Remove "Create" from sidebar

* Fix bug

* Move vue components to `/assets/`, move their CSS with them

* Safari/FF compatibility

* Make panels scrollable again

* Fix extra spacing

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-05-09 17:04:06 -04:00

256 lines
4.8 KiB
CSS

#site-search {
width: 38rem;
position: absolute;
top: 0;
border-radius: var(--wa-border-radius-l);
padding: 0;
margin: 0 auto;
overflow: hidden;
&::part(dialog) {
margin-block-start: 10vh;
margin-block-end: 0;
}
&::part(body) {
padding: 0;
}
&::part(footer) {
justify-content: center;
gap: 0.5rem;
}
@media screen and (max-width: 900px) {
max-width: calc(100% - 2rem);
&::part(dialog) {
margin-block: 1rem;
}
#site-search-container {
max-height: none;
}
}
}
#site-search-container {
display: flex;
flex-direction: column;
max-height: calc(100vh - 18rem);
}
/* Header */
#site-search-container header {
flex: 0 0 auto;
align-items: center;
/* Fixes an iOS Safari 16.4 bug that draws the parent element's border radius incorrectly when showing/hiding results */
border-radius: var(--wa-border-radius-l);
}
#site-search.has-results header {
border-start-start-radius: var(--wa-border-radius-l);
border-start-end-radius: var(--wa-border-radius-l);
border-end-start-radius: 0;
border-end-end-radius: 0;
}
#site-search-input-wrapper {
display: flex;
align-items: center;
margin-block-end: 0.5rem;
}
#site-search-input {
flex: 1 1 auto;
min-width: 0;
border: none;
font: inherit;
font-size: 1.5rem;
background: transparent;
padding: 1rem 1rem 0.5rem 1rem;
margin: 0;
&::placeholder {
color: var(--wa-color-text-quiet);
}
&:focus,
&:focus-visible {
outline: none;
}
}
#site-search-input::-webkit-search-decoration,
#site-search-input::-webkit-search-cancel-button,
#site-search-input::-webkit-search-results-button,
#site-search-input::-webkit-search-results-decoration {
display: none;
}
#site-search-input:focus,
#site-search-input:focus-visible {
--wa-focus-ring: 0;
}
#site-search-body {
flex: 1 1 auto;
overflow-x: hidden;
overflow-y: auto;
}
#site-search.has-results,
#site-search.no-results {
#site-search-body {
border-top: var(--wa-panel-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
}
}
/* Results */
#site-search-listbox {
line-height: 1.4;
list-style: none;
padding: 0;
margin: 0;
a {
display: flex;
gap: 1.5rem;
align-items: center;
text-decoration: none;
padding: 0.5rem 1.5rem;
}
a:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: -2px;
}
@media (hover: hover) {
li a:hover,
li a:hover small {
background-color: var(--wa-color-neutral-fill-normal);
}
}
li[data-selected='true'] a,
li[data-selected='true'] a * {
outline: none;
background-color: var(--wa-color-brand-fill-loud);
color: var(--wa-color-brand-on-loud);
}
h3 {
font-weight: var(--wa-font-weight-semibold);
margin: 0;
}
small {
display: block;
color: var(--wa-color-text-quiet);
}
}
#site-search.has-results #site-search-results {
display: block;
}
/* Search results */
.site-search-result {
padding: 0;
margin: 0;
.site-search-result-icon {
flex: 0 0 auto;
display: flex;
width: 1.75rem;
justify-content: center;
wa-icon {
font-size: 1.75rem;
color: var(--wa-color-neutral-fill-loud);
}
}
.site-search-result-title,
.site-search-result-description,
.site-search-result-url {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.site-search-result-details {
max-width: calc(100% - 4rem);
}
.site-search-result-title {
font-size: 1.25rem;
font-weight: var(--wa-font-weight-semibold);
color: var(--wa-color-brand-on-normal);
}
.site-search-result-description {
font-size: 0.875rem;
color: var(--wa-color-text-normal);
}
.site-search-result-url {
font-size: 0.875rem;
color: var(--wa-color-text-quiet);
}
}
/* Empty state */
#site-search-empty {
display: none;
text-align: center;
font-size: 0.875rem;
color: var(--wa-color-text-quiet);
padding: 3rem 2rem;
wa-icon {
display: block;
width: 2rem;
height: 2rem;
margin-inline: auto;
margin-block-end: 0.5rem;
}
}
#site-search.no-results #site-search-empty {
display: block;
}
/* Footer */
#site-search footer {
flex: 0 0 auto;
display: flex;
flex-direction: row;
justify-content: center;
gap: 2rem;
color: var(--wa-color-text-quiet);
border-top: var(--wa-panel-border-style) var(--wa-panel-border-width) var(--wa-color-neutral-border-quiet);
border-bottom-left-radius: var(--wa-border-radius-l);
border-bottom-right-radius: var(--wa-border-radius-l);
padding: 1rem;
kbd {
display: inline-flex;
height: 1.35rem;
justify-content: center;
align-items: center;
font-weight: var(--wa-font-weight-bold);
&:last-of-type {
margin-inline-end: 0.25rem;
}
> svg {
width: 1em;
height: 1em;
}
}
}