# Exceptions in the standard stylesheet/style inheritance stack 

## Quick list of deviations

*Feel free to add anything, try to make it short and if needed add examples or more explanation at the end of the answer.*

- `"DockedCell"` style is inserted in every `DockedCell` **before** any explicit style. 

  So either you overwrite "DockedCells" in your stylesheet or use explicit options in `Cell`, see `"DockedCell"` example.


- `"InlineCell"` same story but less problematic as "InlineCell" styles are less invasive. So keep that in mind when defining custom `DefaultInlineCellStyle`.

- `"InlineCellEditing"` as above if you want to adjust/switch of orange-ish background that appears during edition you need to modify this style even even for custom `DefaultInlineCellStyle`

- `All` style + `FormatType` issue, see topic linked below for full explanation. TL;DR;? better do not use `All`.

Points from above, with a little background, are mentioned in [Order/Dependency of Styles in a Stylesheet](https://mathematica.stackexchange.com/a/14835/5478).

- `Button(Box)'s` `Appearance` is inserted explicitly during typesetting

 which makes it impossible to set `Button's` appearance via a stylesheet or style with outer `ButtonBoxOptions`. You need to set `Appearance -> Inherited` to do so. See `Button Appearance` example.



## Motivation

The idea and scheme is quite simple see: [**tutorial / WorkingWithStylesheets / Inheritance**](http://reference.wolfram.com/language/tutorial/WorkingWithStylesheets.html)

But there is no way to check where current setting for e.g. `FontSize` comes from. Which makes 'debugging' styles extremely painful. Any exception from the simple scheme makes it even worse, that is why one needs to know what to expect.

## Examples

\- `"DockedCell"`

    CreateDocument[{},
     DockedCells -> Cell["test", "myDockedCell"],
     StyleDefinitions -> Notebook[{
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
        Cell[StyleData["myDockedCell"], Background -> Red, FontSize -> 30]
        }]
     ]

The docked cell is gray despite stylesheet `Background` spec for `myDockedCell`, `FontSize` works well. That is because `"DockedCell"` style has `Background` option. 

So every `Cell[content, style, opts]` inside `DockedCells` effectively becomes `Cell[content, "DockedCell, style, opts]`...

\- `Button Appearance`

    Style[
     Button["LabeL", Print[1]],
     ButtonBoxOptions -> {ImageSize -> {200, 200}, Appearance -> "FramedPalette"}
    ]

`ImageSize` is respected but `Appearance` not, you need `Button["LabeL", Print[1], Appearance -> Inherited]` to make it work but then you ask yourself, why bother with nice setup and not create `myButton` function and put all stuff there?

Official classification of the issue: [116030#comment315233_116030](https://mathematica.stackexchange.com/questions/115888/evaluation-leak-from-dynamic-in-buttons-action/116030#comment315233_116030)