🚚 Remove 'pt' prefix for clarity and decoupling
This commit is contained in:
parent
e7744cbb93
commit
1dfc789172
24 changed files with 729 additions and 734 deletions
|
|
@ -60,28 +60,28 @@ pub(crate) fn add_base_assets(cx: &mut Context) {
|
|||
#[derive(AutoDefault)]
|
||||
pub enum BreakPoint {
|
||||
#[default]
|
||||
None, /* Does not apply. Rest initially assume 1 pixel = 0.0625em */
|
||||
SM, /* PageTop default applies to <= 568px - @media screen and (max-width: 35.5em) */
|
||||
MD, /* PageTop default applies to <= 768px - @media screen and (max-width: 48em) */
|
||||
LG, /* PageTop default applies to <= 992px - @media screen and (max-width: 62em) */
|
||||
XL, /* PageTop default applies to <= 1280px - @media screen and (max-width: 80em) */
|
||||
X2L, /* PageTop default applies to <= 1440px - @media screen and (max-width: 90em) */
|
||||
X3L, /* PageTop default applies to <= 1920px - @media screen and (max-width: 120em) */
|
||||
X2K, /* PageTop default applies to <= 2560px - @media screen and (max-width: 160em) */
|
||||
None, /* Does not apply. Rest initially assume 1 pixel = 0.0625rem */
|
||||
SM, /* PageTop default applies to <= 568px - @media screen and (max-width: 35.5rem) */
|
||||
MD, /* PageTop default applies to <= 768px - @media screen and (max-width: 48rem) */
|
||||
LG, /* PageTop default applies to <= 992px - @media screen and (max-width: 62rem) */
|
||||
XL, /* PageTop default applies to <= 1280px - @media screen and (max-width: 80rem) */
|
||||
X2L, /* PageTop default applies to <= 1440px - @media screen and (max-width: 90rem) */
|
||||
X3L, /* PageTop default applies to <= 1920px - @media screen and (max-width: 120rem) */
|
||||
X2K, /* PageTop default applies to <= 2560px - @media screen and (max-width: 160rem) */
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
impl ToString for BreakPoint {
|
||||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
BreakPoint::None => "pt-bp__none",
|
||||
BreakPoint::SM => "pt-bp__sm",
|
||||
BreakPoint::MD => "pt-bp__md",
|
||||
BreakPoint::LG => "pt-bp__lg",
|
||||
BreakPoint::XL => "pt-bp__xl",
|
||||
BreakPoint::X2L => "pt-bp__x2l",
|
||||
BreakPoint::X3L => "pt-bp__x3l",
|
||||
BreakPoint::X2K => "pt-bp__x2k",
|
||||
BreakPoint::None => "bp__none",
|
||||
BreakPoint::SM => "bp__sm",
|
||||
BreakPoint::MD => "bp__md",
|
||||
BreakPoint::LG => "bp__lg",
|
||||
BreakPoint::XL => "bp__xl",
|
||||
BreakPoint::X2L => "bp__x2l",
|
||||
BreakPoint::X3L => "bp__x3l",
|
||||
BreakPoint::X2K => "bp__x2k",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -105,14 +105,14 @@ pub enum ButtonStyle {
|
|||
impl ToString for ButtonStyle {
|
||||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ButtonStyle::Default => "pt-button__default",
|
||||
ButtonStyle::Info => "pt-button__info",
|
||||
ButtonStyle::Success => "pt-button__success",
|
||||
ButtonStyle::Warning => "pt-button__warning",
|
||||
ButtonStyle::Danger => "pt-button__danger",
|
||||
ButtonStyle::Light => "pt-button__light",
|
||||
ButtonStyle::Dark => "pt-button__dark",
|
||||
ButtonStyle::Link => "pt-button__link",
|
||||
ButtonStyle::Default => "button__default",
|
||||
ButtonStyle::Info => "button__info",
|
||||
ButtonStyle::Success => "button__success",
|
||||
ButtonStyle::Warning => "button__warning",
|
||||
ButtonStyle::Danger => "button__danger",
|
||||
ButtonStyle::Light => "button__light",
|
||||
ButtonStyle::Dark => "button__dark",
|
||||
ButtonStyle::Link => "button__link",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -138,16 +138,16 @@ pub enum FontSize {
|
|||
impl ToString for FontSize {
|
||||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
FontSize::ExtraLarge => "pt-fs__x3l",
|
||||
FontSize::XxLarge => "pt-fs__x2l",
|
||||
FontSize::XLarge => "pt-fs__xl",
|
||||
FontSize::Large => "pt-fs__l",
|
||||
FontSize::Medium => "pt-fs__m",
|
||||
FontSize::ExtraLarge => "fs__x3l",
|
||||
FontSize::XxLarge => "fs__x2l",
|
||||
FontSize::XLarge => "fs__xl",
|
||||
FontSize::Large => "fs__l",
|
||||
FontSize::Medium => "fs__m",
|
||||
FontSize::Normal => "",
|
||||
FontSize::Small => "pt-fs__s",
|
||||
FontSize::XSmall => "pt-fs__xs",
|
||||
FontSize::XxSmall => "pt-fs__x2s",
|
||||
FontSize::ExtraSmall => "pt-fs__x3s",
|
||||
FontSize::Small => "fs__s",
|
||||
FontSize::XSmall => "fs__xs",
|
||||
FontSize::XxSmall => "fs__x2s",
|
||||
FontSize::ExtraSmall => "fs__x3s",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ impl ComponentTrait for Block {
|
|||
}
|
||||
|
||||
fn setup_before_prepare(&mut self, _cx: &mut Context) {
|
||||
self.prepend_classes("pt-block");
|
||||
self.prepend_classes("block__container");
|
||||
}
|
||||
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
|
|
@ -39,9 +39,9 @@ impl ComponentTrait for Block {
|
|||
return PrepareMarkup::With(html! {
|
||||
div id=(id) class=[self.classes().get()] {
|
||||
@if let Some(title) = self.title().using(cx.langid()) {
|
||||
h2 class="pt-block__title" { (title) }
|
||||
h2 class="block__title" { (title) }
|
||||
}
|
||||
div class="pt-block__body" { (block_body) }
|
||||
div class="block__body" { (block_body) }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,19 +35,19 @@ impl ComponentTrait for Branding {
|
|||
let logo = self.logo().render(cx);
|
||||
let title = L10n::l("site_home").using(cx.langid());
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class="pt-branding" {
|
||||
div class="pt-branding__wrapper" {
|
||||
div id=[self.id()] class="branding__container" {
|
||||
div class="branding__inner" {
|
||||
@if !logo.is_empty() {
|
||||
div class="pt-branding__logo" { (logo) }
|
||||
div class="branding__logo" { (logo) }
|
||||
}
|
||||
div class="pt-branding__text" {
|
||||
div class="pt-branding__name" {
|
||||
div class="branding__text" {
|
||||
div class="branding__name" {
|
||||
a href=(self.frontpage()(cx)) title=[title] rel="home" {
|
||||
(self.app_name())
|
||||
}
|
||||
}
|
||||
@if let Some(slogan) = self.slogan().using(cx.langid()) {
|
||||
div class="pt-branding__slogan" {
|
||||
div class="branding__slogan" {
|
||||
(slogan)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,19 +22,19 @@ impl ToString for Direction {
|
|||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Direction::Default => concat_string!(
|
||||
"pt-flex__container pt-flex__row ", BreakPoint::default().to_string()
|
||||
"flex__container flex__row ", BreakPoint::default().to_string()
|
||||
),
|
||||
Direction::Row(breakpoint) => concat_string!(
|
||||
"pt-flex__container pt-flex__row ", breakpoint.to_string()
|
||||
"flex__container flex__row ", breakpoint.to_string()
|
||||
),
|
||||
Direction::RowReverse(breakpoint) => concat_string!(
|
||||
"pt-flex__container pt-flex__row pt-flex__reverse ", breakpoint.to_string()
|
||||
"flex__container flex__row flex__reverse ", breakpoint.to_string()
|
||||
),
|
||||
Direction::Column(breakpoint) => concat_string!(
|
||||
"pt-flex__container pt-flex__col ", breakpoint.to_string()
|
||||
"flex__container flex__col ", breakpoint.to_string()
|
||||
),
|
||||
Direction::ColumnReverse(breakpoint) => concat_string!(
|
||||
"pt-flex__container pt-flex__col pt-flex__reverse ", breakpoint.to_string()
|
||||
"flex__container flex__col flex__reverse ", breakpoint.to_string()
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
@ -57,8 +57,8 @@ impl ToString for WrapAlign {
|
|||
match self {
|
||||
WrapAlign::Default => "".to_owned(),
|
||||
WrapAlign::NoWrap => "flex-nowrap".to_owned(),
|
||||
WrapAlign::Wrap(a) => concat_string!("pt-flex__wrap ", a.to_string()),
|
||||
WrapAlign::WrapReverse(a) => concat_string!("pt-flex__wrap-reverse ", a.to_string()),
|
||||
WrapAlign::Wrap(a) => concat_string!("flex__wrap ", a.to_string()),
|
||||
WrapAlign::WrapReverse(a) => concat_string!("flex__wrap-reverse ", a.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -82,12 +82,12 @@ impl ToString for ContentAlign {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ContentAlign::Default => "",
|
||||
ContentAlign::Start => "pt-flex__align-start",
|
||||
ContentAlign::End => "pt-flex__align-end",
|
||||
ContentAlign::Center => "pt-flex__align-center",
|
||||
ContentAlign::Stretch => "pt-flex__align-stretch",
|
||||
ContentAlign::SpaceBetween => "pt-flex__align-space-between",
|
||||
ContentAlign::SpaceAround => "pt-flex__align-space-around",
|
||||
ContentAlign::Start => "flex__align-start",
|
||||
ContentAlign::End => "flex__align-end",
|
||||
ContentAlign::Center => "flex__align-center",
|
||||
ContentAlign::Stretch => "flex__align-stretch",
|
||||
ContentAlign::SpaceBetween => "flex__align-space-between",
|
||||
ContentAlign::SpaceAround => "flex__align-space-around",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -111,12 +111,12 @@ impl ToString for ContentJustify {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ContentJustify::Default => "",
|
||||
ContentJustify::Start => "pt-flex__justify-start",
|
||||
ContentJustify::End => "pt-flex__justify-end",
|
||||
ContentJustify::Center => "pt-flex__justify-center",
|
||||
ContentJustify::SpaceBetween => "pt-flex__justify-space-between",
|
||||
ContentJustify::SpaceAround => "pt-flex__justify-space-around",
|
||||
ContentJustify::SpaceEvenly => "pt-flex__justify-space-evenly",
|
||||
ContentJustify::Start => "flex__justify-start",
|
||||
ContentJustify::End => "flex__justify-end",
|
||||
ContentJustify::Center => "flex__justify-center",
|
||||
ContentJustify::SpaceBetween => "flex__justify-space-between",
|
||||
ContentJustify::SpaceAround => "flex__justify-space-around",
|
||||
ContentJustify::SpaceEvenly => "flex__justify-space-evenly",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -139,11 +139,11 @@ impl ToString for ItemAlign {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ItemAlign::Default => "",
|
||||
ItemAlign::Top => "pt-flex__item-top",
|
||||
ItemAlign::Bottom => "pt-flex__item-bottom",
|
||||
ItemAlign::Middle => "pt-flex__item-middle",
|
||||
ItemAlign::Stretch => "pt-flex__item-stretch",
|
||||
ItemAlign::Baseline => "pt-flex__item-baseline",
|
||||
ItemAlign::Top => "flex-item__top",
|
||||
ItemAlign::Bottom => "flex-item__bottom",
|
||||
ItemAlign::Middle => "flex-item__middle",
|
||||
ItemAlign::Stretch => "flex-item__stretch",
|
||||
ItemAlign::Baseline => "flex-item__baseline",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -195,15 +195,15 @@ impl ToString for ItemGrow {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ItemGrow::Default => "",
|
||||
ItemGrow::Is1 => "pt-flex__grow-1",
|
||||
ItemGrow::Is2 => "pt-flex__grow-2",
|
||||
ItemGrow::Is3 => "pt-flex__grow-3",
|
||||
ItemGrow::Is4 => "pt-flex__grow-4",
|
||||
ItemGrow::Is5 => "pt-flex__grow-5",
|
||||
ItemGrow::Is6 => "pt-flex__grow-6",
|
||||
ItemGrow::Is7 => "pt-flex__grow-7",
|
||||
ItemGrow::Is8 => "pt-flex__grow-8",
|
||||
ItemGrow::Is9 => "pt-flex__grow-9",
|
||||
ItemGrow::Is1 => "flex-item__grow-1",
|
||||
ItemGrow::Is2 => "flex-item__grow-2",
|
||||
ItemGrow::Is3 => "flex-item__grow-3",
|
||||
ItemGrow::Is4 => "flex-item__grow-4",
|
||||
ItemGrow::Is5 => "flex-item__grow-5",
|
||||
ItemGrow::Is6 => "flex-item__grow-6",
|
||||
ItemGrow::Is7 => "flex-item__grow-7",
|
||||
ItemGrow::Is8 => "flex-item__grow-8",
|
||||
ItemGrow::Is9 => "flex-item__grow-9",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -230,15 +230,15 @@ impl ToString for ItemShrink {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ItemShrink::Default => "",
|
||||
ItemShrink::Is1 => "pt-flex__shrink-1",
|
||||
ItemShrink::Is2 => "pt-flex__shrink-2",
|
||||
ItemShrink::Is3 => "pt-flex__shrink-3",
|
||||
ItemShrink::Is4 => "pt-flex__shrink-4",
|
||||
ItemShrink::Is5 => "pt-flex__shrink-5",
|
||||
ItemShrink::Is6 => "pt-flex__shrink-6",
|
||||
ItemShrink::Is7 => "pt-flex__shrink-7",
|
||||
ItemShrink::Is8 => "pt-flex__shrink-8",
|
||||
ItemShrink::Is9 => "pt-flex__shrink-9",
|
||||
ItemShrink::Is1 => "flex-item__shrink-1",
|
||||
ItemShrink::Is2 => "flex-item__shrink-2",
|
||||
ItemShrink::Is3 => "flex-item__shrink-3",
|
||||
ItemShrink::Is4 => "flex-item__shrink-4",
|
||||
ItemShrink::Is5 => "flex-item__shrink-5",
|
||||
ItemShrink::Is6 => "flex-item__shrink-6",
|
||||
ItemShrink::Is7 => "flex-item__shrink-7",
|
||||
ItemShrink::Is8 => "flex-item__shrink-8",
|
||||
ItemShrink::Is9 => "flex-item__shrink-9",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -267,17 +267,17 @@ impl ToString for ItemSize {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ItemSize::Default => "",
|
||||
ItemSize::Percent10 => "pt-flex__width-10",
|
||||
ItemSize::Percent20 => "pt-flex__width-20",
|
||||
ItemSize::Percent25 => "pt-flex__width-25",
|
||||
ItemSize::Percent33 => "pt-flex__width-33",
|
||||
ItemSize::Percent40 => "pt-flex__width-40",
|
||||
ItemSize::Percent50 => "pt-flex__width-50",
|
||||
ItemSize::Percent60 => "pt-flex__width-60",
|
||||
ItemSize::Percent66 => "pt-flex__width-66",
|
||||
ItemSize::Percent75 => "pt-flex__width-75",
|
||||
ItemSize::Percent80 => "pt-flex__width-80",
|
||||
ItemSize::Percent90 => "pt-flex__width-90",
|
||||
ItemSize::Percent10 => "flex-item__width-10",
|
||||
ItemSize::Percent20 => "flex-item__width-20",
|
||||
ItemSize::Percent25 => "flex-item__width-25",
|
||||
ItemSize::Percent33 => "flex-item__width-33",
|
||||
ItemSize::Percent40 => "flex-item__width-40",
|
||||
ItemSize::Percent50 => "flex-item__width-50",
|
||||
ItemSize::Percent60 => "flex-item__width-60",
|
||||
ItemSize::Percent66 => "flex-item__width-66",
|
||||
ItemSize::Percent75 => "flex-item__width-75",
|
||||
ItemSize::Percent80 => "flex-item__width-80",
|
||||
ItemSize::Percent90 => "flex-item__width-90",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -306,17 +306,17 @@ impl ToString for ItemOffset {
|
|||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
ItemOffset::Default => "",
|
||||
ItemOffset::Offset10 => "pt-flex__offset-10",
|
||||
ItemOffset::Offset20 => "pt-flex__offset-20",
|
||||
ItemOffset::Offset25 => "pt-flex__offset-25",
|
||||
ItemOffset::Offset33 => "pt-flex__offset-33",
|
||||
ItemOffset::Offset40 => "pt-flex__offset-40",
|
||||
ItemOffset::Offset50 => "pt-flex__offset-50",
|
||||
ItemOffset::Offset60 => "pt-flex__offset-60",
|
||||
ItemOffset::Offset66 => "pt-flex__offset-66",
|
||||
ItemOffset::Offset75 => "pt-flex__offset-75",
|
||||
ItemOffset::Offset80 => "pt-flex__offset-80",
|
||||
ItemOffset::Offset90 => "pt-flex__offset-90",
|
||||
ItemOffset::Offset10 => "flex-item__offset-10",
|
||||
ItemOffset::Offset20 => "flex-item__offset-20",
|
||||
ItemOffset::Offset25 => "flex-item__offset-25",
|
||||
ItemOffset::Offset33 => "flex-item__offset-33",
|
||||
ItemOffset::Offset40 => "flex-item__offset-40",
|
||||
ItemOffset::Offset50 => "flex-item__offset-50",
|
||||
ItemOffset::Offset60 => "flex-item__offset-60",
|
||||
ItemOffset::Offset66 => "flex-item__offset-66",
|
||||
ItemOffset::Offset75 => "flex-item__offset-75",
|
||||
ItemOffset::Offset80 => "flex-item__offset-80",
|
||||
ItemOffset::Offset90 => "flex-item__offset-90",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl ComponentTrait for Item {
|
|||
fn setup_before_prepare(&mut self, _cx: &mut Context) {
|
||||
self.prepend_classes(
|
||||
[
|
||||
"pt-flex__item".to_owned(),
|
||||
"flex-item__container".to_owned(),
|
||||
self.grow().to_string(),
|
||||
self.shrink().to_string(),
|
||||
self.size().to_string(),
|
||||
|
|
@ -53,7 +53,7 @@ impl ComponentTrait for Item {
|
|||
};
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class=[self.classes().get()] style=[order] {
|
||||
div class="inner" {
|
||||
div class="flex-item__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ pub enum HeadingSize {
|
|||
impl ToString for HeadingSize {
|
||||
fn to_string(&self) -> String {
|
||||
String::from(match self {
|
||||
HeadingSize::ExtraLarge => "pt-heading__title-x3l",
|
||||
HeadingSize::XxLarge => "pt-heading__title-x2l",
|
||||
HeadingSize::XLarge => "pt-heading__title-xl",
|
||||
HeadingSize::Large => "pt-heading__title-l",
|
||||
HeadingSize::Medium => "pt-heading__title-m",
|
||||
HeadingSize::ExtraLarge => "heading__title-x3l",
|
||||
HeadingSize::XxLarge => "heading__title-x2l",
|
||||
HeadingSize::XLarge => "heading__title-xl",
|
||||
HeadingSize::Large => "heading__title-l",
|
||||
HeadingSize::Medium => "heading__title-m",
|
||||
HeadingSize::Normal => "",
|
||||
HeadingSize::Subtitle => "pt-heading__subtitle",
|
||||
HeadingSize::Subtitle => "heading__subtitle",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
const IMG_FLUID: &str = "pt-img__fluid";
|
||||
const IMG_FIXED: &str = "pt-img__fixed";
|
||||
const IMG_FLUID: &str = "img__fluid";
|
||||
const IMG_FIXED: &str = "img__fixed";
|
||||
|
||||
#[derive(AutoDefault)]
|
||||
pub enum ImageSize {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ impl ComponentTrait for Item {
|
|||
match self.item_type() {
|
||||
ItemType::Void => PrepareMarkup::None,
|
||||
ItemType::Label(label) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__label" {
|
||||
li class="menu__label" {
|
||||
span title=[description] {
|
||||
(left_icon)
|
||||
(label.escaped(cx.langid()))
|
||||
|
|
@ -63,7 +63,7 @@ impl ComponentTrait for Item {
|
|||
}
|
||||
}),
|
||||
ItemType::Link(label, path) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__link" {
|
||||
li class="menu__link" {
|
||||
a href=(path(cx)) title=[description] {
|
||||
(left_icon)
|
||||
(label.escaped(cx.langid()))
|
||||
|
|
@ -72,7 +72,7 @@ impl ComponentTrait for Item {
|
|||
}
|
||||
}),
|
||||
ItemType::LinkBlank(label, path) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__link" {
|
||||
li class="menu__link" {
|
||||
a href=(path(cx)) title=[description] target="_blank" {
|
||||
(left_icon)
|
||||
(label.escaped(cx.langid()))
|
||||
|
|
@ -81,28 +81,28 @@ impl ComponentTrait for Item {
|
|||
}
|
||||
}),
|
||||
ItemType::Html(content) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__html" {
|
||||
li class="menu__html" {
|
||||
(content.render(cx))
|
||||
}
|
||||
}),
|
||||
ItemType::Submenu(label, submenu) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__children" {
|
||||
li class="menu__children" {
|
||||
a href="#" title=[description] {
|
||||
(left_icon)
|
||||
(label.escaped(cx.langid())) i class="pt-menu__icon bi-chevron-down" {}
|
||||
(label.escaped(cx.langid())) i class="menu__icon bi-chevron-down" {}
|
||||
}
|
||||
div class="pt-menu__subs" {
|
||||
div class="menu__subs" {
|
||||
(submenu.render(cx))
|
||||
}
|
||||
}
|
||||
}),
|
||||
ItemType::Megamenu(label, megamenu) => PrepareMarkup::With(html! {
|
||||
li class="pt-menu__children" {
|
||||
li class="menu__children" {
|
||||
a href="#" title=[description] {
|
||||
(left_icon)
|
||||
(label.escaped(cx.langid())) i class="pt-menu__icon bi-chevron-down" {}
|
||||
(label.escaped(cx.langid())) i class="menu__icon bi-chevron-down" {}
|
||||
}
|
||||
div class="pt-menu__subs pt-menu__mega" {
|
||||
div class="menu__subs menu__mega" {
|
||||
(megamenu.render(cx))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ impl ComponentTrait for Megamenu {
|
|||
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class="pt-menu__groups" {
|
||||
div id=[self.id()] class="menu__groups" {
|
||||
(self.groups().render(cx))
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -33,28 +33,28 @@ impl ComponentTrait for Menu {
|
|||
cx.set_param::<bool>(PARAM_BASE_INCLUDE_ICONS, true);
|
||||
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class="pt-menu__container" {
|
||||
div class="pt-menu__wrapper" {
|
||||
div class="pt-menu__main" {
|
||||
div class="pt-menu__overlay" {}
|
||||
nav class="pt-menu__nav" {
|
||||
div class="pt-menu__header" {
|
||||
button type="button" class="pt-menu__arrow" {
|
||||
div id=[self.id()] class="menu__container" {
|
||||
div class="menu__inner" {
|
||||
div class="menu__main" {
|
||||
div class="menu__overlay" {}
|
||||
nav class="menu__nav" {
|
||||
div class="menu__header" {
|
||||
button type="button" class="menu__arrow" {
|
||||
i class="bi-chevron-left" {}
|
||||
}
|
||||
div class="pt-menu__title" {}
|
||||
button type="button" class="pt-menu__close" {
|
||||
div class="menu__title" {}
|
||||
button type="button" class="menu__close" {
|
||||
i class="bi-x" {}
|
||||
}
|
||||
}
|
||||
ul class="pt-menu__section" {
|
||||
ul class="menu__section" {
|
||||
(self.items().render(cx))
|
||||
}
|
||||
}
|
||||
}
|
||||
button
|
||||
type="button"
|
||||
class="pt-menu__trigger"
|
||||
class="menu__trigger"
|
||||
title=[L10n::l("menu_toggle").using(cx.langid())]
|
||||
{
|
||||
span {} span {} span {}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ impl ComponentTrait for Submenu {
|
|||
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class="pt-menu__items" {
|
||||
div id=[self.id()] class="menu__items" {
|
||||
@if let Some(title) = self.title().using(cx.langid()) {
|
||||
h4 class="pt-menu__title" { (title) }
|
||||
h4 class="menu__title" { (title) }
|
||||
}
|
||||
ul {
|
||||
(self.items().render(cx))
|
||||
|
|
|
|||
|
|
@ -29,10 +29,6 @@ impl ComponentTrait for PoweredBy {
|
|||
}
|
||||
}
|
||||
|
||||
fn id(&self) -> Option<String> {
|
||||
Some("pt-poweredby".to_owned())
|
||||
}
|
||||
|
||||
fn weight(&self) -> Weight {
|
||||
self.weight
|
||||
}
|
||||
|
|
@ -58,11 +54,11 @@ impl ComponentTrait for PoweredBy {
|
|||
};
|
||||
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] {
|
||||
div id=[self.id()] class="poweredby__container" {
|
||||
@if let Some(c) = self.copyright() {
|
||||
span class="pt-poweredby__copyright" { (c) "." } " "
|
||||
span class="poweredby__copyright" { (c) "." } " "
|
||||
}
|
||||
span class="pt-poweredby__pagetop" { (poweredby_pagetop) " " (pagetop_logo) }
|
||||
span class="poweredby__pagetop" { (poweredby_pagetop) " " (pagetop_logo) }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -110,7 +106,7 @@ impl PoweredBy {
|
|||
fn logo_color(&self, cx: &mut Context) -> Markup {
|
||||
let logo_txt = &L10n::l("pagetop_logo").using(cx.langid());
|
||||
html! {
|
||||
span class="pt-poweredby__logo" aria-label=[logo_txt] {
|
||||
span class="poweredby__logo" aria-label=[logo_txt] {
|
||||
img src="/base/pagetop-logo.svg" alt=[logo_txt] {}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +116,7 @@ impl PoweredBy {
|
|||
let logo_txt = L10n::l("pagetop_logo").using(cx.langid());
|
||||
let logo_rgb = format!("rgb({},{},{})", r, g, b);
|
||||
html! {
|
||||
span class="pt-poweredby__logo" aria-label=[logo_txt] {
|
||||
span class="poweredby__logo" aria-label=[logo_txt] {
|
||||
svg viewBox="0 0 1614 1614" xmlns="http://www.w3.org/2000/svg" role="img" {
|
||||
path fill=(logo_rgb) d="M 1573,357 L 1415,357 C 1400,357 1388,369 1388,383 L 1388,410 1335,410 1335,357 C 1335,167 1181,13 992,13 L 621,13 C 432,13 278,167 278,357 L 278,410 225,410 225,383 C 225,369 213,357 198,357 L 40,357 C 25,357 13,369 13,383 L 13,648 C 13,662 25,674 40,674 L 198,674 C 213,674 225,662 225,648 L 225,621 278,621 278,1256 C 278,1446 432,1600 621,1600 L 992,1600 C 1181,1600 1335,1446 1335,1256 L 1335,621 1388,621 1388,648 C 1388,662 1400,674 1415,674 L 1573,674 C 1588,674 1600,662 1600,648 L 1600,383 C 1600,369 1588,357 1573,357 L 1573,357 1573,357 Z M 66,410 L 172,410 172,621 66,621 66,410 66,410 Z M 1282,357 L 1282,488 C 1247,485 1213,477 1181,464 L 1196,437 C 1203,425 1199,409 1186,401 1174,394 1158,398 1150,411 L 1133,440 C 1105,423 1079,401 1056,376 L 1075,361 C 1087,352 1089,335 1079,324 1070,313 1054,311 1042,320 L 1023,335 C 1000,301 981,263 967,221 L 1011,196 C 1023,189 1028,172 1021,160 1013,147 997,143 984,150 L 953,168 C 945,136 941,102 940,66 L 992,66 C 1152,66 1282,197 1282,357 L 1282,357 1282,357 Z M 621,66 L 674,66 674,225 648,225 C 633,225 621,237 621,251 621,266 633,278 648,278 L 674,278 674,357 648,357 C 633,357 621,369 621,383 621,398 633,410 648,410 L 674,410 674,489 648,489 C 633,489 621,501 621,516 621,530 633,542 648,542 L 664,542 C 651,582 626,623 600,662 583,653 563,648 542,648 469,648 410,707 410,780 410,787 411,794 412,801 388,805 361,806 331,806 L 331,357 C 331,197 461,66 621,66 L 621,66 621,66 Z M 621,780 C 621,824 586,859 542,859 498,859 463,824 463,780 463,736 498,701 542,701 586,701 621,736 621,780 L 621,780 621,780 Z M 225,463 L 278,463 278,569 225,569 225,463 225,463 Z M 992,1547 L 621,1547 C 461,1547 331,1416 331,1256 L 331,859 C 367,859 400,858 431,851 454,888 495,912 542,912 615,912 674,853 674,780 674,747 662,718 642,695 675,645 706,594 720,542 L 780,542 C 795,542 807,530 807,516 807,501 795,489 780,489 L 727,489 727,410 780,410 C 795,410 807,398 807,383 807,369 795,357 780,357 L 727,357 727,278 780,278 C 795,278 807,266 807,251 807,237 795,225 780,225 L 727,225 727,66 887,66 C 889,111 895,155 905,196 L 869,217 C 856,224 852,240 859,253 864,261 873,266 882,266 887,266 891,265 895,263 L 921,248 C 937,291 958,331 983,367 L 938,403 C 926,412 925,429 934,440 939,447 947,450 954,450 960,450 966,448 971,444 L 1016,408 C 1043,438 1074,465 1108,485 L 1084,527 C 1076,539 1081,555 1093,563 1098,565 1102,566 1107,566 1116,566 1125,561 1129,553 L 1155,509 C 1194,527 1237,538 1282,541 L 1282,1256 C 1282,1416 1152,1547 992,1547 L 992,1547 992,1547 Z M 1335,463 L 1388,463 1388,569 1335,569 1335,463 1335,463 Z M 1441,410 L 1547,410 1547,621 1441,621 1441,410 1441,410 Z" {}
|
||||
path fill=(logo_rgb) d="M 1150,1018 L 463,1018 C 448,1018 436,1030 436,1044 L 436,1177 C 436,1348 545,1468 701,1468 L 912,1468 C 1068,1468 1177,1348 1177,1177 L 1177,1044 C 1177,1030 1165,1018 1150,1018 L 1150,1018 1150,1018 Z M 912,1071 L 1018,1071 1018,1124 912,1124 912,1071 912,1071 Z M 489,1071 L 542,1071 542,1124 489,1124 489,1071 489,1071 Z M 701,1415 L 700,1415 C 701,1385 704,1352 718,1343 731,1335 759,1341 795,1359 802,1363 811,1363 818,1359 854,1341 882,1335 895,1343 909,1352 912,1385 913,1415 L 912,1415 701,1415 701,1415 701,1415 Z M 1124,1177 C 1124,1296 1061,1384 966,1408 964,1365 958,1320 922,1298 894,1281 856,1283 807,1306 757,1283 719,1281 691,1298 655,1320 649,1365 647,1408 552,1384 489,1296 489,1177 L 569,1177 C 583,1177 595,1165 595,1150 L 595,1071 859,1071 859,1150 C 859,1165 871,1177 886,1177 L 1044,1177 C 1059,1177 1071,1165 1071,1150 L 1071,1071 1124,1071 1124,1177 1124,1177 1124,1177 Z" {}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub struct Wrapper {
|
|||
|
||||
impl ComponentTrait for Wrapper {
|
||||
fn new() -> Self {
|
||||
Wrapper::default().with_classes(ClassesOp::Add, "pt-wrapper")
|
||||
Wrapper::default().with_classes(ClassesOp::Add, "wrapper__container")
|
||||
}
|
||||
|
||||
fn id(&self) -> Option<String> {
|
||||
|
|
@ -42,35 +42,35 @@ impl ComponentTrait for Wrapper {
|
|||
match self.wrapper_type() {
|
||||
WrapperType::Container => PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class=[self.classes().get()] {
|
||||
div class="inner" {
|
||||
div class="wrapper__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
}),
|
||||
WrapperType::Main => PrepareMarkup::With(html! {
|
||||
main id=[self.id()] class=[self.classes().get()] {
|
||||
div class="inner" {
|
||||
div class="wrapper__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
}),
|
||||
WrapperType::Section => PrepareMarkup::With(html! {
|
||||
section id=[self.id()] class=[self.classes().get()] {
|
||||
div class="inner" {
|
||||
div class="wrapper__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
}),
|
||||
WrapperType::Header => PrepareMarkup::With(html! {
|
||||
header id=[self.id()] class=[self.classes().get()] {
|
||||
div class="inner" {
|
||||
div class="wrapper__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
}),
|
||||
WrapperType::Footer => PrepareMarkup::With(html! {
|
||||
footer id=[self.id()] class=[self.classes().get()] {
|
||||
div class="inner" {
|
||||
div class="wrapper__inner" {
|
||||
(self.components().render(cx))
|
||||
}
|
||||
}
|
||||
|
|
@ -81,25 +81,25 @@ impl ComponentTrait for Wrapper {
|
|||
|
||||
impl Wrapper {
|
||||
pub fn main() -> Self {
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "pt-main");
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "main__container");
|
||||
c.wrapper_type = WrapperType::Main;
|
||||
c
|
||||
}
|
||||
|
||||
pub fn section() -> Self {
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "pt-section");
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "section__container");
|
||||
c.wrapper_type = WrapperType::Section;
|
||||
c
|
||||
}
|
||||
|
||||
pub fn header() -> Self {
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "pt-header");
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "header__container");
|
||||
c.wrapper_type = WrapperType::Header;
|
||||
c
|
||||
}
|
||||
|
||||
pub fn footer() -> Self {
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "pt-footer");
|
||||
let mut c = Wrapper::default().with_classes(ClassesOp::Add, "footer__container");
|
||||
c.wrapper_type = WrapperType::Footer;
|
||||
c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ pub trait ThemeTrait: PackageTrait + Send + Sync {
|
|||
html! {}
|
||||
} else {
|
||||
html! {
|
||||
div id=[OptionId::new(region_name).get()] class="pt-region" {
|
||||
div class="pt-region__inner" {
|
||||
div id=[OptionId::new(region_name).get()] class="region__container" {
|
||||
div class="region__inner" {
|
||||
(render_region)
|
||||
}
|
||||
}
|
||||
|
|
@ -44,16 +44,16 @@ pub trait ThemeTrait: PackageTrait + Send + Sync {
|
|||
html! {
|
||||
body id=[page.body_id().get()] class=[page.body_classes().get()] {
|
||||
@if let Some(skip) = L10n::l("skip_to_content").using(page.context().langid()) {
|
||||
div class="pt-body__skip" {
|
||||
div class="skip__to_content" {
|
||||
a href=(skip_to) { (skip) }
|
||||
}
|
||||
}
|
||||
div class="pt-body__wrapper" {
|
||||
div class="pt-body__regions" {
|
||||
div class="body__container" {
|
||||
div class="body__inner" {
|
||||
(self.prepare_region(page, "header"))
|
||||
(self.prepare_region(page, "pagetop"))
|
||||
div class="pt-content" {
|
||||
div class="pt-content__inner" {
|
||||
div class="content__container" {
|
||||
div class="content__inner" {
|
||||
(self.prepare_region(page, "content"))
|
||||
(self.prepare_region(page, "sidebar"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue