Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
61c6e60
add updates to resources sidebar
adpare Dec 3, 2024
e441ddf
Merge branch 'develop' of github.com:mitre-attack/attack-website into…
adpare Dec 3, 2024
6c8eb8d
Update typing information
jondricek Oct 29, 2024
521dd41
Merge remote-tracking branch 'origin/master' into develop
jondricek Dec 24, 2024
64b3620
clean up whitespace in scss
jondricek Dec 27, 2024
b1bc81b
Strip whitespace
jondricek Dec 27, 2024
67ee2e7
Merge remote-tracking branch 'origin/master' into develop
jondricek Dec 31, 2024
7ead378
Change anchor-section on Data Source template
jondricek Jan 6, 2025
7e775a5
Sticky Data Component name while scrolling techniques table
clemiller Jan 7, 2025
4c5193f
update copyright year
clemiller Jan 13, 2025
4d90ab6
Update .gitignore
jondricek Jan 21, 2025
f54c32b
Update pelican plugin for webassets to use from PyPI
jondricek Jan 21, 2025
81c736f
Remove old pelican plugin that isn't used
jondricek Jan 21, 2025
f4200c2
Update docstrings
jondricek Jan 21, 2025
f009258
Create new attack-style CSS approach
jondricek Jan 21, 2025
bc51c29
update fonts location and create config file to set variables
adpare Jan 26, 2025
4af425b
move files to accurately display font type
adpare Feb 18, 2025
46b622d
Remove whitespace
jondricek Feb 19, 2025
3a9942e
Remove empty file
jondricek Feb 19, 2025
d343040
Fix bg-alternate issue
jondricek Feb 19, 2025
86c526d
Remove unused files
jondricek Feb 19, 2025
4454203
Add .nvmrc
jondricek Feb 19, 2025
7f6c6c5
Remove unused dependency
jondricek Feb 19, 2025
bfc89df
Update CSS
jondricek Feb 19, 2025
9ddf150
Add npm commands to clean and copy
jondricek Feb 19, 2025
ffe31f4
Add Readme for attack-style directory
jondricek Feb 19, 2025
2ee216c
Merge pull request #530 from mitre-attack/528-update-pelican-webasset…
jondricek Feb 19, 2025
2cb5667
Merge remote-tracking branch 'origin/master' into develop
jondricek Mar 12, 2025
d607ac8
Fix docstrings
jondricek Mar 31, 2025
5b401b1
Add macrotechnique refinement option
jondricek Apr 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ data/pelican_settings.json
# this file is generated by the search module and should not be committed
search_bundle.js
node_modules/

attack-style/dist/
attack-style/docs/
6 changes: 3 additions & 3 deletions CUSTOMIZING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def get_priority():
def get_menu():
return {
"display_name": "Name that will be displayed in the navigation menu"
"module_name": "Your module's name",
"url": "/your_module-s_name/",
"module_name": "Your module's name",
"url": "/your_module-s_name/",
"external_link": False,
"priority": your_module-s_name_config.priority,
"children": [
Expand All @@ -91,7 +91,7 @@ def get_menu():
"display_name": "Module sub-menu external page",
"url": "https://attack.mitre.org",
"external_link": True,
"children": []
"children": []
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 The MITRE Corporation
Copyright 2025 The MITRE Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2015-2024 The MITRE Corporation
Copyright 2015-2025 The MITRE Corporation

Approved for Public Release; Distribution Unlimited. Case Number 19-3504.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ STIX is designed to improve many different capabilities, such as collaborative t

## Notice

Copyright 2015-2024 The MITRE Corporation
Copyright 2015-2025 The MITRE Corporation

Approved for Public Release; Distribution Unlimited. Case Number 19-3504.

Expand Down
1 change: 1 addition & 0 deletions attack-style/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
9 changes: 9 additions & 0 deletions attack-style/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-standard-scss"
],
"ignoreFiles": [
"dist/*"
]
}
56 changes: 56 additions & 0 deletions attack-style/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ATT&CK Style

ATT&CK Style is a JavaScript package that builds the CSS styles for the ATT&CK website.
The outputs are simply 2 CSS files:

* `dist/style-attack.css`
* `dist/style-user.css`

These files are then copied into `<ATT&CK-website-git-repo>/attack-theme/static/`.
Currently this is done manually - no automation.
But also, the CSS is not updated very often.

## Installation

To set up the ATT&CK Style package, follow these steps:

1. **Prerequisite: Ensure Node.js is Installed**:

Make sure you have the latest Node.js LTS version installed.

2. **Navigate to the attack-style Sub-folder**:

Clone the repository, then change your directory to the attack-style sub-folder.

```bash
cd <repository-folder>/attack-style
```

3. **Install Dependencies**:

Run the following command to install the necessary dependencies:

```bash
npm install
```

## Build

1. **Build the CSS Files**:

Use the following command to compile the SCSS files into CSS.
The CSS output files will be generated in the `dist/` directory.

```bash
npm run build
```

2. **Copy CSS Files**:

Copy both `dist/style-attack.css` and `dist/style-user.css` to `<ATT&CK-website-git-repo>/attack-theme/static/`.

```bash
npm run copy
```

The files are now ready to be used in the process to build the ATT&CK website!
55 changes: 55 additions & 0 deletions attack-style/abstracts/_color-functions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@use "sass:color";
@use "sass:map";
@use "sass:string";
@use "variables";

// accessor helper for $colors. Gets the color of the named pair
@function color($name) {
@return map.get(map.get(variables.$colors, $name), "color");
}

// given a color name, get an alternate version of the color, for patterning
// if the base color is dark, the alternate will be slightly lighter.
// if the base color is light, the alternate will be slightly darker.
// contrast, an optional argument, multiplies to create a more distint or similar color. >1 is more distant, <1 is more similar.
@function color-alternate($name, $contrast: 1) {
@return color.mix(color.invert(color($name)), color($name), $weight: $contrast * 5%);
}

/// accessor helper for $colors. Gets the on-color of the named pair
@function on-color($name) {
@return map.get(map.get(variables.$colors, $name), "on-color");
}

/// given a color-name, get an emphasized version of the on-color.
/// The emphasized on-color is less like the background color.
@function on-color-emphasis($name) {
@return color.mix(color.invert(color($name)), on-color($name));
}

// given a color-name, get an deemphasized version of the on-color.
// The deemphasized on-color is more like the background color.
@function on-color-deemphasis($name) {
@return color.mix(color($name), on-color($name), 25%);
}

// given a color name, compute a border color for the color
@function border-color($name) {
@return color.mix(color.invert(color($name)), color($name), 12.5%);

// @return rgba(invert(color($name)), 0.125);
}

// given a color name, compute a border color for the color
@function background-color($name) {
@return color.mix(color.invert(color($name)), color($name), 12.5%);
}

// escape the color. Note param is a color and not a color name: this is not an accessor to the color map above.
// replaces # with %23 in hex colors
// see https://codepen.io/gunnarbittersmann/pen/BoovjR for explanation of why we have to escape # for the background image
@function escape-color($color) {
$hex: color.ie-hex-str($color);

@return "%23" + string.slice($string: #{$hex}, $start-at: 4); // skip #AA in #AARRGGBB
}
42 changes: 42 additions & 0 deletions attack-style/abstracts/_font-faces.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@use "sass:list";
@use "sass:map";

$fonts: (
font-families: (
"Roboto-Thin",
"Roboto-Light",
"Roboto-Regular",
"Roboto-Medium",
"Roboto-Bold",
"Roboto-Black",
"AlegreyaSans-Regular"
),
font-weights: (
100,
300,
400,
500,
700,
900,
400
),
srcs: (
"fonts/Roboto/Roboto-Thin.ttf",
"fonts/Roboto/Roboto-Light.ttf",
"fonts/Roboto/Roboto-Regular.ttf",
"fonts/Roboto/Roboto-Medium.ttf",
"fonts/Roboto/Roboto-Bold.ttf",
"fonts/Roboto/Roboto-Black.ttf",
"fonts/Alegreya_Sans/AlegreyaSans-Regular.ttf"
)
);

/* FONTS */
@for $i from 1 to list.length(map.get($fonts, "font-families")) {
@font-face {
font-family: list.nth(map.get($fonts, "font-families"), $i);
font-style: normal;
font-weight: list.nth(map.get($fonts, "font-weights"), $i);
src: url(list.nth(map.get($fonts, "srcs"), $i));
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@use "sass:math";

// specify a font family for a css block or element
@mixin font($primary, $secondary: sans-serif) {
font-family: $primary, $secondary;
}

// change any presicion point to rem for consistency
@function to-rem($target-val) {
@return #{$target-val/16}rem;
@return #{math.div($target-val, 16)}rem;
}

// base for precision point (not used in @media blocks)
Expand All @@ -17,4 +19,3 @@
@mixin margin($property, $value) {
margin-#{$property}: to-rem(24 * $value);
}

80 changes: 80 additions & 0 deletions attack-style/abstracts/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@use "sass:map";
@use "../config.scss" as config;

/* COLORS */

/// ATT&CK Brand colors
$attack-colors: (
attack-orange: #c63f1f,
attack-blue: #062f4f,
attack-footer: #0b2338,
attack-active: #0156b3
);

/// User colors
$user-colors: (
user-gray: #303435
);

///
/// Colors used across the website.
/// For each color-pair:
/// - "color" refers to the color itself
/// - "on-color" refers to the most readable text-color to appear on top of the color.
/// Note: some colors don't define on-colors. This is because, for these colors, they aren't intended to
/// appear with inner content. For example, "link" is only intended to be used for link text, which inherently
/// cannot have inner text.
///
$colors: (
primary: (
color: if(config.$use-attack-theme, map.get($attack-colors, attack-orange), map.get($user-colors, user-gray)),
on-color: white
),
// used for header and some nav elements
secondary:
(
color: if(config.$use-attack-theme, map.get($attack-colors, attack-blue), map.get($user-colors, user-gray)),
on-color: white
),
// used for some buttons
footer:
(
color: if(config.$use-attack-theme, map.get($attack-colors, attack-footer), map.get($user-colors, user-gray)),
on-color: #87deff
),
// used for footer and some buttons
active:
(
color: if(config.$use-attack-theme, map.get($attack-colors, attack-active), map.get($user-colors, user-gray)),
on-color: #eaeaea
),
// used for active buttons and sidebar links
body:
(
color: white,
on-color: #39434c
),
// primary page body
// example of a dark theme for the site
// body: (color: rgb(50, 50, 50), on-color: #cdcdcd),
link:
(
color: #4f7cac
),
// hyperlinks
matrix-header:
(
color: gray,
on-color: white
),
// color of matrix headers
// query highlight in the search UI
search-highlight:
(
color: yellow,
on-color: black
),
deemphasis: (
color: #303435
)
);
24 changes: 24 additions & 0 deletions attack-style/base/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@use "../abstracts/color-functions";

// used in 404 and contact templates
.deemphasis {
color: color-functions.on-color-deemphasis(body);
}

// background color for the table matrix headers in the home page and the matrices page
.matrix-header {
background-color: color-functions.color(matrix-header);
color: color-functions.on-color(matrix-header);
}

// background color for the table matrix in the home page
%bg-alternate {
background-color: color-functions.color-alternate(body) !important;
}

// .bg-alternate {
// background-color: color-functions.color-alternate(body) !important;
// }
.bg-alternate {
@extend %bg-alternate;
}
12 changes: 12 additions & 0 deletions attack-style/base/_typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@use "../abstracts/color-functions";

.text-label {
text-transform: uppercase;
font-size: 14px;
}

.text-label-small {
font-size: 12px;
color: color-functions.color(deemphasis);
margin-top: -10px;
}
Loading
Loading