separate greentext into "fun text" and make Post/Notification related components
This commit is contained in:
parent
ae345d2c45
commit
48f106b438
13 changed files with 134 additions and 29 deletions
40
src/components/fun_text.style.js
Normal file
40
src/components/fun_text.style.js
Normal 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'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
21
src/components/notification.style.js
Normal file
21
src/components/notification.style.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
export default {
|
||||
name: 'Notification',
|
||||
selector: '.Notification',
|
||||
validInnerComponents: [
|
||||
'Text',
|
||||
'Link',
|
||||
'Icon',
|
||||
'Border',
|
||||
'Button',
|
||||
'ButtonUnstyled',
|
||||
'RichContent',
|
||||
'Input'
|
||||
],
|
||||
defaultRules: [
|
||||
{
|
||||
directives: {
|
||||
background: '--bg'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ export default {
|
|||
'ButtonUnstyled',
|
||||
'Input',
|
||||
'PanelHeader',
|
||||
'MenuItem'
|
||||
'MenuItem',
|
||||
'Post',
|
||||
'Notification'
|
||||
],
|
||||
defaultRules: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ export default {
|
|||
'ButtonUnstyled',
|
||||
'Input',
|
||||
'PanelHeader',
|
||||
'MenuItem'
|
||||
'MenuItem',
|
||||
'Post'
|
||||
],
|
||||
defaultRules: [
|
||||
{
|
||||
|
|
|
|||
21
src/components/post.style.js
Normal file
21
src/components/post.style.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
export default {
|
||||
name: 'Post',
|
||||
selector: '.Status',
|
||||
validInnerComponents: [
|
||||
'Text',
|
||||
'Link',
|
||||
'Icon',
|
||||
'Border',
|
||||
'Button',
|
||||
'ButtonUnstyled',
|
||||
'RichContent',
|
||||
'Input'
|
||||
],
|
||||
defaultRules: [
|
||||
{
|
||||
directives: {
|
||||
background: '--bg'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
17
src/components/rich_content.style.js
Normal file
17
src/components/rich_content.style.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export default {
|
||||
name: 'RichContent',
|
||||
selector: '.RichContent',
|
||||
validInnerComponents: [
|
||||
'Text',
|
||||
'FunText',
|
||||
'Link'
|
||||
],
|
||||
defaultRules: [
|
||||
{
|
||||
directives: {
|
||||
background: '--bg',
|
||||
textNoCssColor: 'yes'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -65,4 +65,12 @@
|
|||
vertical-align: middle;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.greentext {
|
||||
color: var(--funtextGreentext);
|
||||
}
|
||||
|
||||
.cyantext {
|
||||
color: var(--funtextCyantext);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,14 +112,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.greentext {
|
||||
color: var(--textGreentext);
|
||||
}
|
||||
|
||||
.cyantext {
|
||||
color: var(--textCyantext);
|
||||
}
|
||||
|
||||
&.-compact {
|
||||
align-items: top;
|
||||
flex-direction: row;
|
||||
|
|
|
|||
|
|
@ -62,5 +62,15 @@
|
|||
.StatusContent {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
&.faint {
|
||||
.greentext {
|
||||
color: var(--funtextGreentextFaint);
|
||||
}
|
||||
|
||||
.cyantext {
|
||||
color: var(--funtextCyantextFaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue