egroupware_official/api/js/etemplate/Styles/shoelace.ts

67 lines
1.9 KiB
TypeScript
Raw Normal View History

2022-05-12 23:22:49 +02:00
import {css} from "lit";
import {registerIconLibrary} from '@shoelace-style/shoelace/dist/utilities/icon-library.js';
import {egw} from "../../jsapi/egw_global";
/**
* Here is the common overrides and customisations for Shoelace
*/
/**
* Make shoelace icons available
*/
registerIconLibrary('default', {
resolver: name =>
{
return typeof egw !== "undefined" && typeof egw.image == "function" ? (egw.image(name) ?? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg`) : ''
},
});
/**
* Register egw images as an icon library
* @example <sl-icon library="egw" name="infolog/navbar"/>
* @example <sl-icon library="egw" name="5_day_view"/>
*/
if(typeof egw !== "undefined" && typeof egw.image == "function")
{
registerIconLibrary('egw', {
resolver: name =>
{
return (egw.image(name) || '');
},
});
}
2022-05-12 23:22:49 +02:00
/**
* Customise shoelace styles to match our stuff
* External CSS & widget styles will override this
2022-05-12 23:22:49 +02:00
*/
2024-07-15 17:40:28 +02:00
export default [css`
2022-05-12 23:22:49 +02:00
:root,
:host,
.sl-theme-light {
2024-07-15 17:40:28 +02:00
--sl-font-sans: egroupware, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
--sl-button-font-size-medium: var(--sl-font-size-medium);
--sl-input-help-text-font-size-medium: var(--sl-font-size-medium);
--sl-spacing-small: 0.1rem;
--sl-spacing-medium: 0.5rem;
2024-07-15 17:40:28 +02:00
--sl-input-border-radius-small: 2px;
--sl-input-border-radius-medium: 3px;
--sl-input-border-color-focus: #E6E6E6;
--indicator-color: #696969;
--sl-input-focus-ring-color: #26537C;
--sl-focus-ring-width: 2px;
--sl-color-gray-150: hsl(240, 4.9%, 92.5%);
}
2024-07-15 17:40:28 +02:00
.tab-group--top .tab-group__tabs {
--track-width: 3px;
2022-05-12 23:22:49 +02:00
}
.form-control--has-label .form-control__label {
display: inline-block;
color: var(--sl-input-label-color);
margin-right: var(--sl-spacing-medium);
}
2022-05-12 23:22:49 +02:00
`];