mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 07:08:44 +08:00
03deda2147
* 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
221 lines
3.8 KiB
SCSS
221 lines
3.8 KiB
SCSS
// --------------------------------------------------
|
|
// Buttons
|
|
// --------------------------------------------------
|
|
|
|
// Base
|
|
// --------------------------------------------------
|
|
|
|
.btn {
|
|
display: inline-block;
|
|
margin: 0;
|
|
padding: 6px 12px;
|
|
font-weight: 500;
|
|
font-size: $font-0;
|
|
line-height: $line-height-small;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
transition: all 0.25s;
|
|
box-sizing: border-box;
|
|
min-height: 30px;
|
|
|
|
&:active,
|
|
&.btn-active {
|
|
text-shadow: none;
|
|
}
|
|
&[disabled],
|
|
&.disabled {
|
|
cursor: default;
|
|
opacity: 0.4;
|
|
}
|
|
.fa {
|
|
margin-right: 7px;
|
|
}
|
|
&.no-text {
|
|
.fa {
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.btn.hidden {
|
|
display: none;
|
|
}
|
|
|
|
// Default button
|
|
// --------------------------------------------------
|
|
|
|
.btn {
|
|
border: none;
|
|
color: $primary;
|
|
font-weight: normal;
|
|
background: $primary-low;
|
|
|
|
&[href] {
|
|
color: $primary;
|
|
min-height: unset; // ovverides button defaults
|
|
}
|
|
.discourse-no-touch & {
|
|
// only allow hover on no-touch devices
|
|
&:hover,
|
|
&.btn-hover {
|
|
background: $primary-medium;
|
|
color: $secondary;
|
|
}
|
|
}
|
|
&[disabled],
|
|
&.disabled {
|
|
background: $primary-low;
|
|
&:hover {
|
|
color: dark-light-choose($primary-low-mid, $secondary-high);
|
|
}
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.d-icon {
|
|
opacity: 0.7;
|
|
line-height: $line-height-medium; // Match button text line-height
|
|
}
|
|
&.btn-primary .d-icon {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
// Primary button
|
|
// --------------------------------------------------
|
|
|
|
.btn-primary {
|
|
border: none;
|
|
font-weight: normal;
|
|
color: $secondary;
|
|
background: $tertiary;
|
|
|
|
&[href] {
|
|
color: $secondary;
|
|
}
|
|
.discourse-no-touch & {
|
|
// only allow hover on no-touch devices
|
|
&:hover,
|
|
&.btn-hover {
|
|
background: dark-light-choose(
|
|
scale-color($tertiary, $lightness: -20%),
|
|
scale-color($tertiary, $lightness: 20%)
|
|
);
|
|
}
|
|
}
|
|
&:active,
|
|
&.btn-active {
|
|
@include linear-gradient(
|
|
scale-color($tertiary, $lightness: -20%),
|
|
$tertiary
|
|
);
|
|
}
|
|
&[disabled],
|
|
&.disabled {
|
|
background: $tertiary;
|
|
}
|
|
}
|
|
|
|
// Danger button
|
|
// --------------------------------------------------
|
|
|
|
.btn-danger {
|
|
color: $secondary;
|
|
font-weight: normal;
|
|
background: $danger;
|
|
&[href] {
|
|
color: $secondary;
|
|
}
|
|
.discourse-no-touch & {
|
|
// only allow hover on no-touch devices
|
|
&:hover,
|
|
&.btn-hover {
|
|
background: dark-light-choose(
|
|
scale-color($danger, $lightness: -20%),
|
|
scale-color($danger, $lightness: 20%)
|
|
);
|
|
}
|
|
}
|
|
&:active,
|
|
&.btn-active {
|
|
@include linear-gradient(scale-color($danger, $lightness: -20%), $danger);
|
|
}
|
|
&[disabled],
|
|
&.disabled {
|
|
background: $danger;
|
|
}
|
|
}
|
|
|
|
// Social buttons
|
|
// --------------------------------------------------
|
|
|
|
.btn-social {
|
|
color: #fff;
|
|
background: #666;
|
|
&:hover {
|
|
color: #fff;
|
|
}
|
|
&[href] {
|
|
color: $secondary;
|
|
}
|
|
&:before {
|
|
margin-right: 9px;
|
|
font-size: $font-0;
|
|
}
|
|
&.google,
|
|
&.google_oauth2 {
|
|
background: $google;
|
|
color: #333;
|
|
border: 1px solid $primary-low;
|
|
// non-FA SVG icon for Google in login-buttons.hbs
|
|
.d-icon {
|
|
opacity: 0.9;
|
|
}
|
|
}
|
|
&.instagram {
|
|
background: $instagram;
|
|
}
|
|
&.facebook {
|
|
background: $facebook;
|
|
}
|
|
&.cas {
|
|
background: $cas;
|
|
}
|
|
&.twitter {
|
|
background: $twitter;
|
|
}
|
|
&.yahoo {
|
|
background: $yahoo;
|
|
}
|
|
&.github {
|
|
background: $github;
|
|
}
|
|
}
|
|
|
|
// Button Sizes
|
|
// --------------------------------------------------
|
|
|
|
// Small
|
|
|
|
.btn-small {
|
|
padding: 3px 6px;
|
|
font-size: $font-down-1;
|
|
}
|
|
|
|
// Large
|
|
|
|
.btn-large {
|
|
padding: 9px 18px;
|
|
font-size: $font-up-1;
|
|
line-height: $line-height-small;
|
|
}
|
|
|
|
.btn-flat {
|
|
background: transparent;
|
|
border: 0;
|
|
outline: 0;
|
|
line-height: $line-height-small;
|
|
.d-icon {
|
|
opacity: 0.7;
|
|
}
|
|
}
|