diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9d1d37 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +theme.css +.DS_STORE \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fc98e92 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [9.2.0](https://github.com/primefaces/primereact-sass-theme/tree/0.2.0) (2023-03-13) + +**Implemented New Features and Enhancements:** + +- Initial release \ No newline at end of file diff --git a/README.md b/README.md index 7ce9344..e98be10 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# primereact-sass-theme -PrimeReact Theming with SASS +# PrimeReact Theming with SASS + +Visit the [official documentation](https://primereact.org/theming/#customtheme) for more information. diff --git a/package.json b/package.json new file mode 100644 index 0000000..b705778 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "primereact-sass-theme", + "version": "9.2.0", + "description": "PrimeReact Sass Theme", + "homepage": "https://primereact.org/", + "repository": { + "type": "git", + "url": "git+https://github.com/primefaces/primereact-sass-theme.git" + }, + "keywords": [ + "primereact", + "react", + "ui framework", + "component framework", + "ui library", + "component library", + "material", + "bootstrap" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/primefaces/primereact-sass-theme/issues" + } + } + \ No newline at end of file diff --git a/theme-base/_colors.scss b/theme-base/_colors.scss new file mode 100644 index 0000000..076c683 --- /dev/null +++ b/theme-base/_colors.scss @@ -0,0 +1,18 @@ +:root { + @if variable-exists(colors) { + @each $name, $color in $colors { + @for $i from 0 through 5 { + @if ($i == 0) { + --#{$name}-50:#{tint($color, (5 - $i) * 19%)}; + } + @else { + --#{$name}-#{$i * 100}:#{tint($color, (5 - $i) * 19%)}; + } + } + + @for $i from 1 through 4 { + --#{$name}-#{($i + 5) * 100}:#{shade($color, $i * 15%)}; + } + } + } +} \ No newline at end of file diff --git a/theme-base/_common.scss b/theme-base/_common.scss new file mode 100644 index 0000000..464a189 --- /dev/null +++ b/theme-base/_common.scss @@ -0,0 +1,68 @@ +* { + box-sizing: border-box; +} + +.p-component { + font-family: $fontFamily; + font-size: $fontSize; + font-weight: $fontWeight; +} + +.p-component-overlay { + background-color: $maskBg; + transition-duration: $transitionDuration; +} + +.p-disabled, .p-component:disabled { + opacity: $disabledOpacity; +} + +.p-error { + color: $errorColor; +} + +.p-text-secondary { + color: $textSecondaryColor; +} + +.pi { + font-size: $primeIconFontSize; +} + +.p-link { + font-size: $fontSize; + font-family: $fontFamily; + border-radius: $borderRadius; + + &:focus { + @include focused(); + } +} + +.p-component-overlay-enter { + animation: p-component-overlay-enter-animation 150ms forwards; +} + +.p-component-overlay-leave { + animation: p-component-overlay-leave-animation 150ms forwards; +} + +.p-component-overlay { + @keyframes p-component-overlay-enter-animation { + from { + background-color: transparent; + } + to { + background-color: var(--maskbg); + } + } + + @keyframes p-component-overlay-leave-animation { + from { + background-color: var(--maskbg); + } + to { + background-color: transparent; + } + } +} \ No newline at end of file diff --git a/theme-base/_components.scss b/theme-base/_components.scss new file mode 100644 index 0000000..5e0d898 --- /dev/null +++ b/theme-base/_components.scss @@ -0,0 +1,102 @@ +@import '_mixins'; +@import '_common'; +@import '_colors'; + +//Input +@import './components/input/_autocomplete'; +@import './components/input/_calendar'; +@import './components/input/_cascadeselect'; +@import './components/input/_checkbox'; +@import './components/input/_chips'; +@import './components/input/_colorpicker'; +@import './components/input/_dropdown'; +@import './components/input/_editor'; +@import './components/input/_inputgroup'; +@import './components/input/_inputnumber'; +@import './components/input/_inputswitch'; +@import './components/input/_inputtext'; +@import './components/input/_listbox'; +@import './components/input/_mention'; +@import './components/input/_multiselect'; +@import './components/input/_password'; +@import './components/input/_radiobutton'; +@import './components/input/_rating'; +@import './components/input/_selectbutton'; +@import './components/input/_slider'; +@import './components/input/_treeselect'; +@import './components/input/_togglebutton'; + +//Button +@import './components/button/_button'; +@import './components/button/_splitbutton'; +@import './components/button/_speeddial'; + +//Data +@import './components/data/_carousel'; +@import './components/data/_datatable'; +@import './components/data/_dataview'; +@import './components/data/_datascroller'; +@import './components/data/_filter'; +@import './components/data/_fullcalendar'; +@import './components/data/_orderlist'; +@import './components/data/_organizationchart'; +@import './components/data/_paginator'; +@import './components/data/_picklist'; +@import './components/data/_tree'; +@import './components/data/_treetable'; +@import './components/data/_timeline'; + +//Panel +@import './components/panel/_accordion'; +@import './components/panel/_card'; +@import './components/panel/_fieldset'; +@import './components/panel/_divider'; +@import './components/panel/_panel'; +@import './components/panel/_splitter'; +@import './components/panel/_scrollpanel'; +@import './components/panel/_tabview'; +@import './components/panel/_toolbar'; + +//Overlay +@import './components/overlay/_confirmpopup'; +@import './components/overlay/_dialog'; +@import './components/overlay/_overlaypanel'; +@import './components/overlay/_sidebar'; +@import './components/overlay/_tooltip'; + +//File +@import './components/file/_fileupload'; + +//Menu +@import './components/menu/_breadcrumb'; +@import './components/menu/_contextmenu'; +@import './components/menu/_dock'; +@import './components/menu/_megamenu'; +@import './components/menu/_menu'; +@import './components/menu/_menubar'; +@import './components/menu/_panelmenu'; +@import './components/menu/_slidemenu'; +@import './components/menu/_steps'; +@import './components/menu/_tabmenu'; +@import './components/menu/_tieredmenu'; + +//Messages +@import './components/messages/_inlinemessage'; +@import './components/messages/_message'; +@import 'components/messages/toast'; + +//MultiMedia +@import './components/multimedia/_galleria'; +@import './components/multimedia/_image'; + +//Misc +@import './components/misc/_avatar'; +@import './components/misc/_chip'; +@import './components/misc/_scrolltop'; +@import './components/misc/_skeleton'; +@import './components/misc/_tag'; +@import './components/misc/_inplace'; +@import './components/misc/_progressbar'; +@import './components/misc/_terminal'; +@import './components/misc/_blockui'; +@import './components/misc/_badge'; \ No newline at end of file diff --git a/theme-base/_mixins.scss b/theme-base/_mixins.scss new file mode 100644 index 0000000..1f8d38f --- /dev/null +++ b/theme-base/_mixins.scss @@ -0,0 +1,199 @@ +@mixin icon-override($icon) { + &:before { + content: $icon; + } +} + +@mixin focused() { + outline: $focusOutline; + outline-offset: $focusOutlineOffset; + box-shadow: $focusShadow; +} + +@mixin focused-inset() { + outline: $focusOutline; + outline-offset: $focusOutlineOffset; + box-shadow: inset $focusShadow; +} + +@mixin focused-input() { + @include focused(); + border-color: $inputFocusBorderColor; +} + +@mixin focused-listitem() { + outline: $focusOutline; + outline-offset: $focusOutlineOffset; + box-shadow: $inputListItemFocusShadow; +} + +@mixin invalid-input() { + border-color: $inputErrorBorderColor; +} + +@mixin menuitem-link { + padding: $menuitemPadding; + color: $menuitemTextColor; + border-radius: $menuitemBorderRadius; + transition: $listItemTransition; + user-select: none; + + .p-menuitem-text { + color: $menuitemTextColor; + } + + .p-menuitem-icon { + color: $menuitemIconColor; + margin-right: $inlineSpacing; + } + + .p-submenu-icon { + color: $menuitemIconColor; + } + + &:not(.p-disabled):hover { + background: $menuitemHoverBg; + + .p-menuitem-text { + color: $menuitemTextHoverColor; + } + + .p-menuitem-icon { + color: $menuitemIconHoverColor; + } + + .p-submenu-icon { + color: $menuitemIconHoverColor; + } + } + + &:focus { + @include focused-listitem(); + } +} + +@mixin horizontal-rootmenuitem-link { + padding: $horizontalMenuRootMenuitemPadding; + color: $horizontalMenuRootMenuitemTextColor; + border-radius: $horizontalMenuRootMenuitemBorderRadius; + transition: $listItemTransition; + user-select: none; + + .p-menuitem-text { + color: $horizontalMenuRootMenuitemTextColor; + } + + .p-menuitem-icon { + color: $horizontalMenuRootMenuitemIconColor; + margin-right: $inlineSpacing; + } + + .p-submenu-icon { + color: $horizontalMenuRootMenuitemIconColor; + margin-left: $inlineSpacing; + } + + &:not(.p-disabled):hover { + background: $horizontalMenuRootMenuitemHoverBg; + + .p-menuitem-text { + color: $horizontalMenuRootMenuitemTextHoverColor; + } + + .p-menuitem-icon { + color: $horizontalMenuRootMenuitemIconHoverColor; + } + + .p-submenu-icon { + color: $horizontalMenuRootMenuitemIconHoverColor; + } + } + + &:focus { + @include focused-listitem(); + } +} + +@mixin placeholder { + ::-webkit-input-placeholder { + @content + } + :-moz-placeholder { + @content + } + ::-moz-placeholder { + @content + } + :-ms-input-placeholder { + @content + } +} + +@mixin scaledPadding($val, $scale) { + padding: nth($val, 1) * $scale nth($val, 2) * $scale; +} + +@mixin scaledFontSize($val, $scale) { + font-size: $val * $scale; +} + +@mixin nested-submenu-indents($val, $index, $length) { + ul { + li { + a { + padding-left: $val * ($index + 1); + } + + @if $index < $length { + @include nested-submenu-indents($val, $index + 2, $length); + } + } + } +} + +@mixin action-icon($enabled: true) { + width: $actionIconWidth; + height: $actionIconHeight; + color: $actionIconColor; + border: $actionIconBorder; + background: $actionIconBg; + border-radius: $actionIconBorderRadius; + transition: $actionIconTransition; + + @if $enabled { + &:enabled:hover { + @include action-icon-hover(); + } + } @else { + &:hover { + @include action-icon-hover(); + } + } + + &:focus { + @include focused(); + } +} + +@mixin action-icon-hover() { + color: $actionIconHoverColor; + border-color: $actionIconHoverBorderColor; + background: $actionIconHoverBg; +} + +@mixin button-states { + //