Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-11-28 12:40:40

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Custom styles for backend editor textareas

Hey there,
is there a way to do this?

Can I use styles-txp.css in /themes for that purpose?
Or can I use a directive in config.php to link to a custom css?

(As always, I feel like I did this before, but for the life of me I can’t remember how nor where I did it ,–)

Cheers!
-f

Offline

#2 2018-11-28 12:56:10

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,435
Website

Re: Custom styles for backend editor textareas

See custom-example.css. If I recall correctly, the admin theme will load custom.css on its own if it’s in your admin theme’s assets/css folder. Phil’s put all manner of useful information in there.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2018-11-28 13:08:30

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Re: Custom styles for backend editor textareas

Yes! I knew it was in there somewhere.

Danke Dir, Jakob!

Offline

#4 2018-11-28 13:40:00

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Re: Custom styles for backend editor textareas

So, just to have this complete & in one place:

As proposed by Bloke right here #299719, the directive in config.php goes like this …

define('admin_custom_css', 'custom-funtoosh.css');

(In custom-example.css it is still define('admin_custom_css', true); )

… and, as a quick example, say you want to add custom fonts to your textareas, this would do the trick, in textpattern/admin-themes/hive/assets/css/custom-funtoosh.css add sth. along the lines of:

@font-face {
    font-family: 'funtoosh';
    src: url('/relative/path/fonts/funtoosh.woff2') format('woff2');
}
#title, #body, #excerpt { 
    font-family: 'funtoosh', sans-serif; 
}

Offline

#5 2018-11-28 14:05:10

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,435
Website

Re: Custom styles for backend editor textareas

I think you can even just name your file custom.css in the assets folder of your admin theme (either directly in hive or in one of your own) and it will automatically be detected without you having to add anything to config.php.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2018-11-29 13:14:47

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Re: Custom styles for backend editor textareas

Jakob, that’s correct, as soon as a file named custom.css is available in textpattern/admin-themes/hive/assets/css/ it is being used, no need to modify the config!

Offline

Board footer

Powered by FluxBB