Is there a way to make night mode avalible for only one permission group?

  • IanM replied to this.

    typ1k not currently, no.

    What is the use case you have in mind for this? It’s not something we’ve considered so far as we didn’t see a need for it

    Hmmm I'm thinking something like a paid membership, where only premium members can have the feature.

      6 days later

      Why are there 3 options in the header for guest and admin? In the dropdown there are only 2 as it should be.

        Yolo The third is for the automatic adjustment regarding the system preference you have.

        1.4.1

        • export JavaScript components for extensions to use

        Updating

        composer require fof/nightmode:"*"
        php flarum cache:clear
        a month later

        If the night mode is active, even here on discuss and you see the coded text you will notice some text blue are not readable.

        add_shortcode( 'note', 'sc_note' );
        
        function sc_note( $atts, $content = null ) {
        	 if ( current_user_can( 'publish_posts' ) )
        		return '<div class="note">'.$content.'</div>';
        	return '';
        }

        Can you tell me how I can fix this?

        The issue is caused by this CSS applied by the Dark mode extension:

        .hljs-meta .hljs-string, .hljs-regexp, .hljs-string {
          color: #032f62;
        }

        This blue are not good for text in the code and dark mode, you need choose a more light blue.

        I have the issue here.

        For now I will use this useful message to customize the bad CSS

        2 months later

        Works thank you all for making this clever extension. It installed without a hitch.

        4 months later

        I need a little help.

        I'm making a bbcode that calls an iframe. I should pass as a parameter whether we are in dark or light mode.
        How can this be solved?

         return [ 
          (new Extend\Frontend('forum'))
          ->css(__DIR__.'/less/forum.less'),
            (new Extend\Formatter)
            ->configure(function (Configurator $config) {
                 $config->BBCodes->addCustom(
                  '[stl-file name={SIMPLETEXT1} path={URL} uuid={IDENTIFIER} size={SIMPLETEXT2}]',
                   '<div class="stliframe" style="--aspect-ratio: 16/9;">
                   <iframe 
                     src="/stl-viewer/?file=/assets/files/{URL}&color={???}"
        ...
        2 months later

        Any reason I cannot add custom dark CSS for the backend admin panel?
        There are some things in the dark mode CSS I want to change as the text is dark.

        My CSS is setup like this in Appearance / Custom CSS

        /*----------------------
        LIGHTMODE
        ----------------------*/
        /*Normal CSS*/  
        
        
        /*----------------------
        DARMODE
        ----------------------*/
        body when (@config-dark-mode =true) {
        	background: #181818 !important;
        /*Other CSS*/  
        }
        
        /*----------------------
        RESPONSIVE MEDIA
        ----------------------*/
        @media screen and (max-width: 800px) {
        /*Other CSS*/  
        }
        @media screen and (max-width: 768px) {
        /*Other CSS*/  
        }

        If there is no option to do it, could you add one? I was hoping (@config-dark-mode =true) {} can do it.

        2 months later

        FriendsOfFlarum after updating to 1.8.1, I get a site wide white screen.

        For some reason this is working now, after going through the troubleshooting further even though I didn't change anything. Very odd stuff.


        I narrowed it down to this extension after spending a few hours disabling and enabling multiple extensions. Not sure what changed to cause this.

        2 months later

        1.5.3

        • Fix global color-scheme not being updated properly when setting page theme
          • Resolves scroll bar not updating color in certain cases
        2 months later

        The issue

        Code in night mode is hard to read.

        1.PNG

        Flarum information

        Post your output of php flarum info here. Without this information providing support will take longer!
        Flarum core: 1.8.3
        PHP version: 8.1.21
        MySQL version: 5.7.40-log
        Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, mbstring, SPL, session, pcntl, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvsem, tokenizer, xml, xmlreader, xmlwriter, zip, fileinfo, redis, exif, Zend OPcache
        +----------------------------------------+---------+--------+
        | Flarum Extensions                      |         |        |
        +----------------------------------------+---------+--------+
        | ID                                     | Version | Commit |
        +----------------------------------------+---------+--------+
        | askvortsov-auto-moderator              | v0.1.3  |        |
        | flarum-likes                           | v1.8.0  |        |
        | flarum-flags                           | v1.8.0  |        |
        | flarum-tags                            | v1.8.0  |        |
        | antoinefr-money                        | v1.3.1  |        |
        | flarum-suspend                         | v1.8.1  |        |
        | fof-pages                              | 1.0.7   |        |
        | fof-oauth                              | 1.5.3   |        |
        | flarum-approval                        | v1.8.0  |        |
        | fof-polls                              | 1.4.2   |        |
        | flarum-mentions                        | v1.8.2  |        |
        | ziiven-money-leaderboard               | v0.1.7  |        |
        | xypp-pay-to-read                       | v1.1.1  |        |
        | v17development-user-badges             | v1.1.0  |        |
        | v17development-seo                     | v1.8.0  |        |
        | the-turk-flamoji                       | 1.0.4   |        |
        | pipecraft-id-slug                      | v1.1.0  |        |
        | noriods-auto-more                      | v1.0.0  |        |
        | justoverclock-username-blacklist       | 0.1.0   |        |
        | imeepo-more-bbcode                     | v1.0.2  |        |
        | glowingblue-redis-setup                | 1.2.1   |        |
        | fof-user-bio                           | 1.3.0   |        |
        | fof-socialprofile                      | 1.1.5   |        |
        | fof-sitemap                            | 2.2.0   |        |
        | fof-recaptcha                          | 1.3.0   |        |
        | fof-profile-image-crop                 | 1.1.6   |        |
        | fof-pretty-mail                        | 1.1.1   |        |
        | fof-nightmode                          | 1.5.3   |        |
        | fof-links                              | 1.2.0   |        |
        | fof-ignore-users                       | 1.2.0   |        |
        | fof-default-group                      | 1.1.1   |        |
        | fof-byobu                              | 1.3.2   |        |
        | fof-best-answer                        | 1.3.3   |        |
        | flarumite-simple-discussion-views      | 1.2.1   |        |
        | flarum-subscriptions                   | v1.8.0  |        |
        | flarum-sticky                          | v1.8.0  |        |
        | flarum-statistics                      | v1.8.0  |        |
        | flarum-pusher                          | v1.8.0  |        |
        | flarum-nicknames                       | v1.8.0  |        |
        | flarum-markdown                        | v1.8.0  |        |
        | flarum-lock                            | v1.8.0  |        |
        | flarum-lang-english                    | v1.8.0  |        |
        | flarum-lang-chinese-simplified         | v1.3.0  |        |
        | flarum-emoji                           | v1.8.0  |        |
        | flarum-bbcode                          | v1.8.0  |        |
        | ffans-clipboardjs                      | v1.0.0  |        |
        | datlechin-chatgpt                      | v0.3.0  |        |
        | darkle-fancybox                        | 1.1.2   |        |
        | clarkwinkelmann-vote-with-money        | 1.0.0   |        |
        | clarkwinkelmann-scout                  | 0.3.5   |        |
        | clarkwinkelmann-prominent-post-numbers | 1.0.0   |        |
        | clarkwinkelmann-money-rewards          | 1.0.0   |        |
        +----------------------------------------+---------+--------+
        Base URL: https://www.nodeloc.com
        Installation path: /www/wwwroot/youqian.me
        Queue driver: redis
        Session driver: redis (Code override. Configured to file)
        Scheduler status: Active
        Mail driver: smtp
        Debug mode: off
        Merged 1 post from Code in night mode is hard to read..
        6 months later

        I am getting HTTP ERROR 500 error after installing this and the fun thing is after installing this extension if I am installing any extension or enabled them I get the same error and after refreshing 4 or 5 times the error is gone, same goes to my frontend webpage . Please help me through it .