Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0] Refactor common styles to be more modular #113

Open
micjamking opened this issue Feb 7, 2016 · 0 comments
Open

[1.0] Refactor common styles to be more modular #113

micjamking opened this issue Feb 7, 2016 · 0 comments

Comments

@micjamking
Copy link
Owner

Currently, most of the styles are contained in a single common Sass partial; this was initially done for efficiency when only elements and console panels were being skinned. With the addition of the elements panel, and (minor) potential for further growth, it makes the current structure unscalable and difficult to maintain.

app/styles/modules/_common-styles.scss#L2

@mixin styles(
$background,            // Background
$background-highlight,  // Background - Highlight
$comments,              // Comments / Secondary Content
$body-text,             // Body text / default code / primary content
$body-text-highlight,   // Optional emphasized content
$property,              // CSS Properties
$pseudo,                // CSS3 pseudo-selectors / elements
$keyword,               // CSS Keywords (!important, etc.)
$selectors,             // HTML Tags / CSS ID/Class Selectors / JS Keywords
$strings,               // HTML/CSS/JS Strings
$operators,             // CSS Tag Selectors / JS Operators (in Canary)
$accent                 // Accent / Highlight
){

  // Panels
  .elements,
  .elements ::shadow,
  .sources,
  .console,
  .console-view-wrapper {
    ...
  }
}

Ideally, the @mixin styles() itself would not change, avoiding any negative impact on the theme Sass files. The proposed solution would be to use individual @include's within the @mixin styles() itself, and edit the styles as a mixin within unique partials.

@mixin styles(
$background,            // Background
$background-highlight,  // Background - Highlight
$comments,              // Comments / Secondary Content
$body-text,             // Body text / default code / primary content
$body-text-highlight,   // Optional emphasized content
$property,              // CSS Properties
$pseudo,                // CSS3 pseudo-selectors / elements
$keyword,               // CSS Keywords (!important, etc.)
$selectors,             // HTML Tags / CSS ID/Class Selectors / JS Keywords
$strings,               // HTML/CSS/JS Strings
$operators,             // CSS Tag Selectors / JS Operators (in Canary)
$accent                 // Accent / Highlight
){

  // General
  @include common();
  @include devtools_window();

  // Panels
  @include panel_elements();
  @include panel_sources();
  @include panel_console();
}

The theme-config.scss will need to be updated to include the additional partials containing the mixins for building the theme.

app/styles/base/_theme-config.scss#L12

/**
 * Modules
 */
@import "modules/common";
@import "modules/devtools-window";
@import "modules/panel-console";
@import "modules/panel-elements";
@import "modules/panel-sources";
@import "modules/styles";
@micjamking micjamking self-assigned this Feb 7, 2016
@micjamking micjamking added this to the 1.0 milestone Feb 7, 2016
@micjamking micjamking changed the title Refactor common styles to be more modular [1.0] Refactor common styles to be more modular Feb 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant