discourse/plugins/discourse-local-dates/assets/stylesheets/common/discourse-local-dates.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

286 lines
5.0 KiB
SCSS
Raw Normal View History

2018-05-31 01:05:41 +08:00
.discourse-local-date {
> * {
pointer-events: none;
}
&.cooked-date {
color: var(--primary);
2018-05-31 01:05:41 +08:00
cursor: pointer;
border-bottom: 1px dashed var(--primary-medium);
white-space: nowrap;
Upgrade to FontAwesome 5 (take two) (#6673) * Add missing icons to set * Revert FA5 revert This reverts commit 42572ff * use new SVG syntax in locales * Noscript page changes (remove login button, center "powered by" footer text) * Cast wider net for SVG icons in settings - include any _icon setting for SVG registry (offers better support for plugin settings) - let themes store multiple pipe-delimited icons in a setting - also replaces broken onebox image icon with SVG reference in cooked post processor * interpolate icons in locales * Fix composer whisper icon alignment * Add support for stacked icons * SECURITY: enforce hostname to match discourse hostname This ensures that the hostname rails uses for various helpers always matches the Discourse hostname * load SVG sprite with pre-initializers * FIX: enable caching on SVG sprites * PERF: use JSONP for SVG sprites so they are served from CDN This avoids needing to deal with CORS for loading of the SVG Note, added the svg- prefix to the filename so we can quickly tell in dev tools what the file is * Add missing SVG sprite JSONP script to CSP * Upgrade to FA 5.5.0 * Add support for all FA4.7 icons - adds complete frontend and backend for renamed FA4.7 icons - improves performance of SvgSprite.bundle and SvgSprite.all_icons * Fix group avatar flair preview - adds an endpoint at /svg-sprites/search/:keyword - adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset * Remove FA 4.7 font files
2018-11-27 05:49:57 +08:00
.d-icon {
color: var(--primary);
2018-05-31 01:05:41 +08:00
}
&.past {
border-bottom-color: var(--primary-low-mid);
}
&.past[data-countdown] {
color: var(--primary-medium);
}
2018-05-31 01:05:41 +08:00
}
}
div[data-tippy-root] {
.locale-dates-previews {
max-width: 360px;
.preview {
display: flex;
flex-direction: column;
padding: 5px;
.timezone {
font-weight: 700;
}
&.current {
background: var(--tertiary-low);
}
DEV: FloatKit (#23541) Second iteration of https://github.com/discourse/discourse/pull/23312 with a fix for embroider not resolving an export file using .gjs extension. --- This PR introduces three new concepts to Discourse codebase through an addon called "FloatKit": - menu - tooltip - toast ## Tooltips ### Component Simple cases can be express with an API similar to DButton: ```hbs <DTooltip @label={{i18n "foo.bar"}} @icon="check" @content="Something" /> ``` More complex cases can use blocks: ```hbs <DTooltip> <:trigger> {{d-icon "check"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> Something </:content> </DTooltip> ``` ### Service You can manually show a tooltip using the `tooltip` service: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), options ) // and later manual close or destroy it tooltipInstance.close(); tooltipInstance.destroy(); // you can also just close any open tooltip through the service this.tooltip.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const tooltipInstance = this.tooltip.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners tooltipInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` ## Menus Menus are very similar to tooltips and provide the same kind of APIs: ### Component ```hbs <DMenu @icon="plus" @label={{i18n "foo.bar"}}> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </DMenu> ``` They also support blocks: ```hbs <DMenu> <:trigger> {{d-icon "plus"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </:content> </DMenu> ``` ### Service You can manually show a menu using the `menu` service: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), options ) // and later manual close or destroy it menuInstance.close(); menuInstance.destroy(); // you can also just close any open tooltip through the service this.menu.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const menuInstance = this.menu.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners menuInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` ## Toasts Interacting with toasts is made only through the `toasts` service. A default component is provided (DDefaultToast) and can be used through dedicated service methods: - this.toasts.success({ ... }); - this.toasts.warning({ ... }); - this.toasts.info({ ... }); - this.toasts.error({ ... }); - this.toasts.default({ ... }); ```javascript this.toasts.success({ data: { title: "Foo", message: "Bar", actions: [ { label: "Ok", class: "btn-primary", action: (componentArgs) => { // eslint-disable-next-line no-alert alert("Closing toast:" + componentArgs.data.title); componentArgs.close(); }, } ] }, }); ``` You can also provide your own component: ```javascript this.toasts.show(MyComponent, { autoClose: false, class: "foo", data: { baz: 1 }, }) ``` Co-authored-by: Martin Brennan <mjrbrennan@gmail.com> Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Co-authored-by: David Taylor <david@taylorhq.com> Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-09-12 21:50:26 +08:00
}
}
DEV: FloatKit (#23312) This PR introduces three new UI elements to Discourse codebase through an addon called "FloatKit": - menu - tooltip - toast Simple cases can be express with an API similar to DButton: ```hbs <DTooltip @label={{i18n "foo.bar"}} @icon="check" @content="Something" /> ``` More complex cases can use blocks: ```hbs <DTooltip> <:trigger> {{d-icon "check"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> Something </:content> </DTooltip> ``` You can manually show a tooltip using the `tooltip` service: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), options ) // and later manually close or destroy it tooltipInstance.close(); tooltipInstance.destroy(); // you can also just close any open tooltip through the service this.tooltip.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const tooltipInstance = this.tooltip.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners tooltipInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` Menus are very similar to tooltips and provide the same kind of APIs: ```hbs <DMenu @icon="plus" @label={{i18n "foo.bar"}}> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </DMenu> ``` They also support blocks: ```hbs <DMenu> <:trigger> {{d-icon "plus"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </:content> </DMenu> ``` You can manually show a menu using the `menu` service: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), options ) // and later manually close or destroy it menuInstance.close(); menuInstance.destroy(); // you can also just close any open tooltip through the service this.menu.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const menuInstance = this.menu.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners menuInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` Interacting with toasts is made only through the `toasts` service. A default component is provided (DDefaultToast) and can be used through dedicated service methods: - this.toasts.success({ ... }); - this.toasts.warning({ ... }); - this.toasts.info({ ... }); - this.toasts.error({ ... }); - this.toasts.default({ ... }); ```javascript this.toasts.success({ data: { title: "Foo", message: "Bar", actions: [ { label: "Ok", class: "btn-primary", action: (componentArgs) => { // eslint-disable-next-line no-alert alert("Closing toast:" + componentArgs.data.title); componentArgs.close(); }, } ] }, }); ``` You can also provide your own component: ```javascript this.toasts.show(MyComponent, { autoClose: false, class: "foo", data: { baz: 1 }, }) ``` Co-authored-by: Martin Brennan <mjrbrennan@gmail.com> Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Co-authored-by: David Taylor <david@taylorhq.com> Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-09-12 21:06:51 +08:00
.download-calendar {
text-align: right;
cursor: pointer;
margin-top: 0.5em;
}
DEV: FloatKit (#23541) Second iteration of https://github.com/discourse/discourse/pull/23312 with a fix for embroider not resolving an export file using .gjs extension. --- This PR introduces three new concepts to Discourse codebase through an addon called "FloatKit": - menu - tooltip - toast ## Tooltips ### Component Simple cases can be express with an API similar to DButton: ```hbs <DTooltip @label={{i18n "foo.bar"}} @icon="check" @content="Something" /> ``` More complex cases can use blocks: ```hbs <DTooltip> <:trigger> {{d-icon "check"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> Something </:content> </DTooltip> ``` ### Service You can manually show a tooltip using the `tooltip` service: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), options ) // and later manual close or destroy it tooltipInstance.close(); tooltipInstance.destroy(); // you can also just close any open tooltip through the service this.tooltip.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const tooltipInstance = this.tooltip.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners tooltipInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const tooltipInstance = await this.tooltip.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` ## Menus Menus are very similar to tooltips and provide the same kind of APIs: ### Component ```hbs <DMenu @icon="plus" @label={{i18n "foo.bar"}}> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </DMenu> ``` They also support blocks: ```hbs <DMenu> <:trigger> {{d-icon "plus"}} <span>{{i18n "foo.bar"}}</span> </:trigger> <:content> <ul> <li>Foo</li> <li>Bat</li> <li>Baz</li> </ul> </:content> </DMenu> ``` ### Service You can manually show a menu using the `menu` service: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), options ) // and later manual close or destroy it menuInstance.close(); menuInstance.destroy(); // you can also just close any open tooltip through the service this.menu.close(); ``` The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service: ```javascript const menuInstance = this.menu.register( document.querySelector(".my-span"), options ) // when done you can destroy the instance to remove the listeners menuInstance.destroy(); ``` Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args: ```javascript const menuInstance = await this.menu.show( document.querySelector(".my-span"), { component: MyComponent, data: { foo: 1 } } ) ``` ## Toasts Interacting with toasts is made only through the `toasts` service. A default component is provided (DDefaultToast) and can be used through dedicated service methods: - this.toasts.success({ ... }); - this.toasts.warning({ ... }); - this.toasts.info({ ... }); - this.toasts.error({ ... }); - this.toasts.default({ ... }); ```javascript this.toasts.success({ data: { title: "Foo", message: "Bar", actions: [ { label: "Ok", class: "btn-primary", action: (componentArgs) => { // eslint-disable-next-line no-alert alert("Closing toast:" + componentArgs.data.title); componentArgs.close(); }, } ] }, }); ``` You can also provide your own component: ```javascript this.toasts.show(MyComponent, { autoClose: false, class: "foo", data: { baz: 1 }, }) ``` Co-authored-by: Martin Brennan <mjrbrennan@gmail.com> Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com> Co-authored-by: David Taylor <david@taylorhq.com> Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-09-12 21:50:26 +08:00
}
.discourse-local-dates-create-modal .modal-footer {
2018-05-31 01:05:41 +08:00
display: flex;
align-items: center;
justify-content: flex-start;
&:before,
&:after {
2018-05-31 01:05:41 +08:00
content: none;
}
.advanced-mode-btn {
margin-left: auto;
}
}
.discourse-local-dates-create-modal {
box-sizing: border-box;
min-height: 320px;
2018-05-31 01:05:41 +08:00
display: flex;
flex-direction: row;
padding: 0.5em;
overflow: auto;
2018-05-31 01:05:41 +08:00
.form {
flex: 1 0 0px;
2018-05-31 01:05:41 +08:00
label {
font-weight: 700;
}
.date-time-configuration {
display: flex;
.fake-input {
display: none;
}
2019-03-28 23:34:56 +08:00
.timezone-input {
width: 100%;
&.is-expanded {
.select-kit-header {
border: 1px solid var(--primary-medium);
}
}
.select-kit-header {
padding: 0.5em 0.5em;
border: 1px solid var(--primary-low);
.d-icon {
margin-right: 1em;
}
.caret-icon {
margin-right: 0;
}
}
}
2018-05-31 01:05:41 +08:00
.date-time-control {
position: relative;
display: flex;
border: 1px solid var(--primary-low);
&.is-filled,
&.is-selected {
.date-time {
color: var(--primary);
background: var(--secondary);
}
.d-icon {
color: var(--primary-high);
}
}
&.from {
border-radius: 5px 5px 0 0;
.date-time {
border-radius: 5px 5px 0 0;
2018-05-31 01:05:41 +08:00
}
&.is-selected {
border-color: var(--tertiary);
}
}
&.to {
border-radius: 0 0 5px 5px;
margin-bottom: 1em;
.date-time {
border-radius: 0 0 5px 5px;
padding-right: 3em;
}
&.is-selected {
border-color: var(--tertiary);
}
}
.date-time {
color: var(--primary-medium);
background: var(--primary-very-low);
padding: 1em 0.5em 1em 2em;
border: 0;
outline: none;
flex: 1;
@include ellipsis;
width: 100%;
justify-content: flex-start;
&:focus {
background-color: var(--tertiary-50);
}
}
.d-icon {
position: absolute;
margin-top: auto;
margin-bottom: auto;
left: 0.5em;
top: 0;
bottom: 0;
color: var(--primary-medium);
}
.delete-to-date {
position: absolute;
margin-top: auto;
margin-bottom: auto;
right: 0;
width: 30px;
top: 0;
bottom: 0;
color: var(--primary-high);
border-radius: 0 0 5px 0;
}
2018-05-31 01:05:41 +08:00
}
.inputs-panel {
flex: 1;
}
2018-05-31 01:05:41 +08:00
}
2019-03-28 23:34:56 +08:00
.preview {
text-align: center;
margin-top: 0;
margin-bottom: 0.5em;
display: flex;
align-items: center;
padding: 0.5em;
flex-wrap: wrap;
b {
margin-right: 0.5em;
margin-left: 0.5em;
}
2019-03-28 23:34:56 +08:00
b + p {
margin: 0;
display: inline-block;
}
2018-05-31 01:05:41 +08:00
}
.recurrence {
.recurrence-input {
width: 350px;
2018-05-31 01:05:41 +08:00
}
}
}
.validation-error {
margin-bottom: 0.5em;
}
.format {
.format-input {
width: 280px;
}
}
.formats {
list-style: none;
padding: 0;
margin: 0;
.format {
.previewed-format {
color: var(--primary-medium);
}
}
}
.control-group.recurrence,
.control-group.format,
.control-group.timezones {
margin-top: 1em;
}
2018-05-31 01:05:41 +08:00
.timezones-input {
width: 350px;
2018-05-31 01:05:41 +08:00
}
}
2019-03-28 23:34:56 +08:00
html:not(.mobile-view) {
.fixed-modal .discourse-local-dates-create-modal.modal-body {
width: 40em; // using ems to scale with user font size
max-width: 100vw; // avoids overflow if someone has extreme font-sizes impacting width
max-height: 400px !important;
}
}
html.mobile-view {
.fixed-modal .discourse-local-dates-create-modal.modal-body {
max-height: 400px !important;
.date-time-configuration {
flex-direction: column;
}
2019-03-28 23:34:56 +08:00
.calendar-date-time-input {
width: 100%;
margin: 0 0 1em 0;
2019-03-28 23:34:56 +08:00
.pika-single {
justify-content: center;
2019-03-28 23:34:56 +08:00
}
.time-picker {
padding-top: 6px;
}
}
2019-03-28 23:34:56 +08:00
}
}