separate greentext into "fun text" and make Post/Notification related components

This commit is contained in:
Henry Jameson 2024-02-12 19:17:17 +02:00
commit 48f106b438
13 changed files with 134 additions and 29 deletions

View file

@ -0,0 +1,40 @@
export default {
name: 'FunText',
selector: '/*fun-text*/',
virtual: true,
variants: {
greentext: '.greentext',
cyantext: '.cyantext'
},
states: {
faint: '.faint'
},
defaultRules: [
{
directives: {
textColor: '--text',
textAuto: 'preserve'
}
},
{
state: ['faint'],
directives: {
textOpacity: 0.5
}
},
{
variant: 'greentext',
directives: {
textColor: '--cGreen',
textAuto: 'preserve'
}
},
{
variant: 'cyantext',
directives: {
textColor: '--cBlue',
textAuto: 'preserve'
}
}
]
}

View file

@ -0,0 +1,21 @@
export default {
name: 'Notification',
selector: '.Notification',
validInnerComponents: [
'Text',
'Link',
'Icon',
'Border',
'Button',
'ButtonUnstyled',
'RichContent',
'Input'
],
defaultRules: [
{
directives: {
background: '--bg'
}
}
]
}

View file

@ -3,8 +3,7 @@
// TODO Copypaste from Status, should unify it somehow
.Notification {
border-bottom: 1px solid;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
border-color: var(--border);
word-wrap: break-word;
word-break: break-word;

View file

@ -9,7 +9,9 @@ export default {
'ButtonUnstyled',
'Input',
'PanelHeader',
'MenuItem'
'MenuItem',
'Post',
'Notification'
],
defaultRules: [
{

View file

@ -13,7 +13,8 @@ export default {
'ButtonUnstyled',
'Input',
'PanelHeader',
'MenuItem'
'MenuItem',
'Post'
],
defaultRules: [
{

View file

@ -0,0 +1,21 @@
export default {
name: 'Post',
selector: '.Status',
validInnerComponents: [
'Text',
'Link',
'Icon',
'Border',
'Button',
'ButtonUnstyled',
'RichContent',
'Input'
],
defaultRules: [
{
directives: {
background: '--bg'
}
}
]
}

View file

@ -0,0 +1,17 @@
export default {
name: 'RichContent',
selector: '.RichContent',
validInnerComponents: [
'Text',
'FunText',
'Link'
],
defaultRules: [
{
directives: {
background: '--bg',
textNoCssColor: 'yes'
}
}
]
}

View file

@ -65,4 +65,12 @@
vertical-align: middle;
object-fit: contain;
}
.greentext {
color: var(--funtextGreentext);
}
.cyantext {
color: var(--funtextCyantext);
}
}

View file

@ -112,14 +112,6 @@
}
}
.greentext {
color: var(--textGreentext);
}
.cyantext {
color: var(--textCyantext);
}
&.-compact {
align-items: top;
flex-direction: row;

View file

@ -62,5 +62,15 @@
.StatusContent {
flex: 1;
min-width: 0;
&.faint {
.greentext {
color: var(--funtextGreentextFaint);
}
.cyantext {
color: var(--funtextCyantextFaint);
}
}
}
</style>

View file

@ -2,34 +2,21 @@ export default {
name: 'Text',
selector: '/*text*/',
virtual: true,
variants: {
greentext: '.greentext'
},
states: {
faint: '.faint'
},
defaultRules: [
{
component: 'Text',
directives: {
textColor: '--text',
textAuto: 'no-preserve'
}
},
{
component: 'Text',
state: ['faint'],
directives: {
textOpacity: 0.5
}
},
{
component: 'Text',
variant: 'greentext',
directives: {
textColor: '--cGreen',
textAuto: 'preserve'
}
}
]
}