What is this in my Custom CSS field?

Krothos
Krothos

I have the following in my Custom CSS field:

          /* Sets the size for the Custom CSS text area */

               #custom-css-field.flat-field{

                    height: 1000px !important;}

When I remove it, nothing seems to change. Trying to remember why I had this here.... any enlightenment?

Thanks.

 

Comments

  • Bortas
    Bortas
    Posts: 645

    Yeah, someone on here posted it, and it was genious, we all latched on and forgot, thanks for the reminder!

    Its for the GM only, style, advanced section. It makes the place where you input CSS taller, instead of so short.

    -bort

  • Krothos
    Krothos
    Posts: 230

    Ah, that's what I thought. Of course, now it's working like that. hehe

     

  • cgregory
    cgregory
    Posts: 780

    If you want to get rid of the !important the full css for it is

    .campaign-settings #advanced-settings #custom-css-field{

    height: 1000px;

    }

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Krothos
    Krothos
    Posts: 230

    Thanks for the suggestion. Is there a reason to remove !important? In other words, is using one CSS line better over the other?

  • cgregory
    cgregory
    Posts: 780

    Generally if you are using !important you are hitting the wrong css specificity to override the original css. This can cause you to have it also affect other parts of your site than what you intend.

    For example, there could be a .wiki-page #custom-css-field (there isn't but for this example lets assume there is). If you used the !important you'd be hitting both of them.  Using .campaign-settings #advanced-settings #custom-css-field you are telling it to only affect the custom-css-field found after an advanced-settings which is found after the campaign-setting class and leave the others alone.

    The other reason I prefer not using !important is that I can look at my code that has specificity and tell what exactly it is doing.  And where in OP's original code I can find their default values (if any) so I know how I changed it.

    Here is the code from OP

    .campaign-settings #advanced-settings #custom-css-field {

        height: 310px;

    }

    A quick look at the two tells me I've increased the height of the custom-css-field from 310px to 1000px.

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Abersade
    Abersade
    Posts: 417

    That was my code, shared is so folks could have an editing window that wasn't tiny by default.

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    GM of Stream of Kairos

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Krothos
    Krothos
    Posts: 230

    @Abersade - Thank you for originally providing it. It's extremely helpful.  :)

     

  • weasel0
    weasel0
    Posts: 435

    Was that to alter the original box or for when the pages kept loading completely collapsed boxes?

  • cgregory
    cgregory
    Posts: 780

    To alter the original box.

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

Sign In or Register to comment.

March 2024
Wrath of the Highborn

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions