Skip to main content
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot
added 13 characters in body; edited title
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

Quick way to preview and tweak style definitionsstyles?

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

There's also the clunky style previewer as well:

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the stylestyled expressions and definitions for named styles. For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

What I've tried:

Here's some code to get started:

DynamicModule[{x = ""}, TextGrid[{{"Input", "Output"}, 
    {InputField[Dynamic[x], String, ContinuousAction -> True],           
    Dynamic[DisplayForm[Check[DisplayForm@ToExpression[x], "-"]]]}}, 
   Alignment -> Center, Dividers -> All]]

Obviously, it doesn't work well:

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!

Quick way to preview and tweak style definitions?

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

There's also the clunky style previewer as well:

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the style definitions for named styles. For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

What I've tried:

Here's some code to get started:

DynamicModule[{x = ""}, TextGrid[{{"Input", "Output"}, 
    {InputField[Dynamic[x], String, ContinuousAction -> True],           
    Dynamic[DisplayForm[Check[DisplayForm@ToExpression[x], "-"]]]}}, 
   Alignment -> Center, Dividers -> All]]

Obviously, it doesn't work well:

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!

Quick way to preview and tweak styles?

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

There's also the clunky style previewer as well:

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview styled expressions and definitions for named styles. For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

What I've tried:

Here's some code to get started:

DynamicModule[{x = ""}, TextGrid[{{"Input", "Output"}, 
    {InputField[Dynamic[x], String, ContinuousAction -> True],           
    Dynamic[DisplayForm[Check[DisplayForm@ToExpression[x], "-"]]]}}, 
   Alignment -> Center, Dividers -> All]]

Obviously, it doesn't work well:

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!
added 445 characters in body
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

There's also the clunky style previewer as well:

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the style definitions for named styles.

  For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

What I've tried:

Here's some code to get started:

DynamicModule[{x = ""}, TextGrid[{{"Input", "Output"}, 
    {InputField[Dynamic[x], String, ContinuousAction -> True],           
    Dynamic[DisplayForm[Check[DisplayForm@ToExpression[x], "-"]]]}}, 
   Alignment -> Center, Dividers -> All]]

Obviously, it doesn't work well:

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the style definitions for named styles.

  For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

There's also the clunky style previewer as well:

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the style definitions for named styles. For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

What I've tried:

Here's some code to get started:

DynamicModule[{x = ""}, TextGrid[{{"Input", "Output"}, 
    {InputField[Dynamic[x], String, ContinuousAction -> True],           
    Dynamic[DisplayForm[Check[DisplayForm@ToExpression[x], "-"]]]}}, 
   Alignment -> Center, Dividers -> All]]

Obviously, it doesn't work well:

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!
Tweeted twitter.com/StackMma/status/1215740307947520000
Notice added Authoritative reference needed by M.R.
Bounty Started worth 150 reputation by M.R.
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

Quick way to preview and tweak style definitions?

I find the old stylesheet UI clunky and hard to use:

FrontEndExecute @ FrontEndToken @ "EditStyleDefinitions"

enter image description here

Without using the above, I'd like to programmatically quickly tweak and preview the style definitions for named styles.

For example, let's try copying "Entity" and renaming it "MyRoundedFrameStyle" giving it different colors and frame properties:

CellPrint @ Cell[BoxData[
    TemplateBox[{"\"United States\"", , , "country"}, "Entity"]], 
  "Input"]

enter image description here

Notes:

  • Being able to do this inline and programmatically within a notebook would "be best" ;)
  • I haven't seen any ResourceFunction that could help here...
  • Perhaps there are some undocumented symbols that let one ergonomically copy-and-tweak (predefined cell or box) styles for quick reuse?
  • If nothing like this exists, StylePlayground would be a good name!